会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
ning0_o
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
下一页
2016年9月2日
删除数组
摘要: 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
阅读(137)
评论(0)
推荐(0)
2016年9月1日
移动端拖拽的时候不触发点击事件
摘要: 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
阅读(660)
评论(0)
推荐(0)
2016年8月22日
css3渐变
摘要: 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
阅读(125)
评论(0)
推荐(0)
2016年8月18日
this
摘要: this指的是,调用函数的那个对象
阅读全文
posted @ 2016-08-18 17:24 ning0_o
阅读(92)
评论(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
阅读(204)
评论(0)
推荐(0)
2016年8月12日
设置margin-top值时,溢出到父元素
摘要: 给子元素margin-top时,若这个子元素前面没有其他内容,这个margin-top值会应用到父元素上解决方案,给父元素设置:beforebody:before{ content: ""; display: table; /*或者display: inline-blo...
阅读全文
posted @ 2016-08-12 10:03 ning0_o
阅读(635)
评论(0)
推荐(0)
修改浏览器默认的滚动条样式
摘要: /*滚动条 start*/ ::-webkit-scrollbar { width: 10px; height: 4px; background-color: #F5F5F5; } /*定义滚动条轨道 内阴影+圆角*/ ...
阅读全文
posted @ 2016-08-12 09:53 ning0_o
阅读(181)
评论(0)
推荐(0)
2016年7月26日
数组操作
摘要: 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
阅读(123)
评论(0)
推荐(0)
2016年7月25日
js注册在标签上的点击事件
摘要: 点击function fnTrClick(dd){ console.log("window对象",this, "当前对象",$(dd).attr("id"));}给onclick传递一个this,点击的当前对象,在函数中使用的this是window对象
阅读全文
posted @ 2016-07-25 16:51 ning0_o
阅读(514)
评论(0)
推荐(0)
设置inline-block布局造成的幺蛾子事
摘要: 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
阅读(104)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
下一页
公告