常用[js,css,jquery,html]】的更多相关文章

目录: 一.javascript事件和属性 二.jquery事件和方法 三.js 四.css 五.html 六.js操作cookies 七.插件 javascript事件和属性 事件 onblur         //当失去输入焦点后产生该事件 onfocus       //当输入获得焦点后,产生该事件 onchange     //当文字值改变,并失去焦点时,产生该事件 onselect      //事件会在文本框中的文本被选中时发生. removeChild//方法删除指定节点. rep…
在布局中引用通用到js,或者css: <?php Yii::app()->clientScript->registerCoreScript('jquery');?>  //注意这个将会插到<title></title>标签上..所以title标签要放在head文档顶部防止.jquery没有第一个加入 在view中引用单独的js,css这样做: $cs=Yii::app()->clientScript; //引入本地站点 $cs->register…
JS部分 <script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script> <script type="text/javascript"> jQuery(document).ready(function ($) { if (window.history && window.history.pushState) { $(window).on('p…
1.动态更改设置属性(class  style 都是属性) $("#sendPhoneNum").attr("class", "n_input3"); $("#top_notice").attr("style", "display:block;"); 2.通过css()设置样式 $("#sendPhoneNum").css("display", &…
设置用户粘贴板中的文本信息:window.clipboardData.setData('Text', location.href); 获取用户粘贴板中的文本信息: window.clipboardData.getData('Text'); 清空用户粘贴板中的文本信息: window.clipboardData.clearData('Text'); 禁止复制:在元素中添加oncopy事件,并return false即可: 禁止粘贴:在元素中添加onpaste事件中,return false即可:…
原创内容,转载请注明出处! 为了方便资源管理和提升工作效率,常用的js和css文件的加载应该放在一个统一文件里面完成,也方便后续的资源维护.所以我用js写了以下方法,存放在“sourceController.js”文件内. /** * Created by MingChen on 2016/11/3. */ function sourceController() { this.root = ""; this.callfunc = null; // 回调函数 this.css = [];…
我的移动端media html{font-size:10px} @media screen and (min-width:321px) and (max-width:375px){html{font-size:11px}} @media screen and (min-width:376px) and (max-width:414px){html{font-size:12px}} @media screen and (min-width:415px) and (max-width:639px){…
原生JS研究:学习jquery源码,收集整理常用JS函数: 1. JS获取原生class(getElementsByClass) 转自:http://blog.csdn.net/kongjiea/article/details/24308413 function getClass (classname,obj) {//obj就是找的标签范围;      var obj=obj||document;//如果obj没有参数传进来的话就为假,就返回document;      var arr=[];/…
昨天被问数组方法的时候,问到sort()方法是否会改变原来的数组.本来我猜是不会,也是这么说,马上我又觉得,知识这种东西,不确定的时候直接说不确定或不知道就好,只是凭借着不确定的猜测或者是记忆,害人害己,于是我又回答不知道.结果果然...我记错了0.0 还是自己总结测试一下比较靠谱,印象也比较深刻.欢迎大家提出相关意见或建议,提前谢谢哈~ 一.原生js方法 1.遍历数组 in(同时也是对象遍历属性的方法) var a = [1, 2, 3]; for (x in a) { console.log…
// 每个弹窗的标识 var x =0; var idzt = new Array(); var Window = function(config){ //ID不重复 idzt[x] = "zhuti"+x; //弹窗ID //初始化,接收参数 this.config = { width : config.width || 300, //宽度 height : config.height || 200, //高度 buttons : config.buttons || '', //默认…