摘要: var r;var arr = ['apple', 'strawberry', 'banana', 'pear', 'apple', 'orange', 'orange', 'strawberry']; r = arr.filter(function (element, index, self) { 阅读全文
posted @ 2017-03-31 10:35 绯红的花io 阅读(5230) 评论(0) 推荐(0) 编辑
摘要: JavaScript环境中内置的setTimeout()函数实现和下面的伪代码类似: 阅读全文
posted @ 2017-03-23 17:42 绯红的花io 阅读(122) 评论(0) 推荐(0) 编辑
摘要: arr.sort(function (a, b){ return a - b; }); //正序排列数字 arr.sort(function (a, b){ return b - a; }); //倒序排列数字 阅读全文
posted @ 2017-02-21 10:49 绯红的花io 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 添加多个事件: 相同方法: $(".table").on("mouseover mouseout","td",function(){ /* */ }); 不同方法: $(".table").on({ mouseenter:function(){ /* */ }, mouseleave:functio 阅读全文
posted @ 2017-01-04 16:55 绯红的花io 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 如果想要动态改变定位位置的值,例如改变TOP的值,IE下必须要给TOP一个初始值,不然不生效。。 阅读全文
posted @ 2017-01-03 15:08 绯红的花io 阅读(531) 评论(0) 推荐(0) 编辑
摘要: css兼容ie7: 做页面的时候用负边距居中的时候在IE7下面,父节点中的overflow:hiden失效的问题,查阅了一些资料,总结一下解决方法。 问题原因: 当父元素的直接子元素或者下级子元素的样式拥有position:relative属性时,父元素的overflow:hidden属性就会失效。 阅读全文
posted @ 2016-12-27 20:37 绯红的花io 阅读(2292) 评论(0) 推荐(1) 编辑
摘要: margin-top,margin-left,margin-right,margin-bottom 是body中的属性th,td 是表格的元素与之对应的是padding-top,padding-left,padding-right,padding-bottom,以及 vspace,hspace,ce 阅读全文
posted @ 2016-12-16 10:22 绯红的花io 阅读(2152) 评论(0) 推荐(0) 编辑
摘要: 页面跳转: window.location.href('地址') window.open('地址', '_self') 打开新窗口: window.open('地址', '_blank') 只显示地址栏:window.open('地址', 'title', 'location=1, height=2 阅读全文
posted @ 2016-11-23 08:56 绯红的花io 阅读(2116) 评论(0) 推荐(0) 编辑
摘要: 在head标签里加<base target="_blank">,这样页面中所有的a链接都是新窗口中打开了。。 阅读全文
posted @ 2016-09-27 09:58 绯红的花io 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Javascript、Jquery获取浏览器和屏幕各种高度宽度 Javascript: alert(document.body.clientWidth); //网页可见区域宽(body) alert(document.body.clientHeight); //网页可见区域高(body) alert 阅读全文
posted @ 2016-09-22 17:47 绯红的花io 阅读(183) 评论(0) 推荐(0) 编辑