上一页 1 ··· 4 5 6 7 8 9 10 下一页
摘要: 1、delete arr[index]只删除值,数组索引不变、长度不变var arr = ["a", "b", 1, 2, 3];delete arr[2];console.log(arr);2、arr.splice(index, n);从index位置删除n个元素var arr = ["a", "... 阅读全文
posted @ 2016-09-02 15:17 ning0_o 阅读(129) 评论(0) 推荐(0) 编辑
摘要: var isClick = true;$('li').on('touchstart', function(e){ isClick = true;});$('li').on('touchmove', function(e){ isClick = false;});$('li').on('tou... 阅读全文
posted @ 2016-09-01 10:05 ning0_o 阅读(641) 评论(0) 推荐(0) 编辑
摘要: 1、线性渐变background:-moz-linear-gradient(left,#ace,#f96);/*Mozilla*/background:-webkit-gradient(linear,0 50%,100% 50%,from(#ace),to(#f96));/*Old gradient... 阅读全文
posted @ 2016-08-22 11:33 ning0_o 阅读(122) 评论(0) 推荐(0) 编辑
摘要: this指的是,调用函数的那个对象 阅读全文
posted @ 2016-08-18 17:24 ning0_o 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1、普通函数function normalFn(){ console.log(this); //window return "这是一个普通函数";}normalFn();2、构造函数(构造函数建议首字母大写,与普通函数区分开)function Animal(name){ this.name=... 阅读全文
posted @ 2016-08-18 14:14 ning0_o 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 给子元素margin-top时,若这个子元素前面没有其他内容,这个margin-top值会应用到父元素上解决方案,给父元素设置:beforebody:before{ content: ""; display: table; /*或者display: inline-blo... 阅读全文
posted @ 2016-08-12 10:03 ning0_o 阅读(625) 评论(0) 推荐(0) 编辑
摘要: /*滚动条 start*/ ::-webkit-scrollbar { width: 10px; height: 4px; background-color: #F5F5F5; } /*定义滚动条轨道 内阴影+圆角*/ ... 阅读全文
posted @ 2016-08-12 09:53 ning0_o 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1、数组截取concat():基于原数组,添加元素,并创建新数组slice():获取指定位置的元素,并创建新数组var arr = [1,2];var arr1 = arr.concat(3);console.log("arr=", arr, "arr1=", arr1);//arr=[1,2] a... 阅读全文
posted @ 2016-07-26 11:07 ning0_o 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 点击function fnTrClick(dd){ console.log("window对象",this, "当前对象",$(dd).attr("id"));}给onclick传递一个this,点击的当前对象,在函数中使用的this是window对象 阅读全文
posted @ 2016-07-25 16:51 ning0_o 阅读(507) 评论(0) 推荐(0) 编辑
摘要: 1、文本错位display: inline-block;vertical-align: bottom;2、两个容器之间出现间隔第一种,word-spacing:0;// 给父容器设置display: table;第二种,word-spacing:0;// 给父容器设置font-size: 0; 阅读全文
posted @ 2016-07-25 11:19 ning0_o 阅读(97) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 下一页