摘要: var bs = new Browser(); if(bs.userBrowser() == 'firefox'){ document.body.addEventListener("DOMMouseScroll", test, false); ... 阅读全文
posted @ 2015-08-25 14:03 sunhaikuo 阅读(550) 评论(0) 推荐(0) 编辑
摘要: 方式1(已解决兼容性): if(window.attachEvent){ window.document.body.attachEvent("onclick", test); }else if(window.addEventListener) { ... 阅读全文
posted @ 2015-08-25 11:31 sunhaikuo 阅读(171) 评论(0) 推荐(0) 编辑
摘要: (0.22223343534).toFixed(2)结果:0.22 阅读全文
posted @ 2015-08-11 17:41 sunhaikuo 阅读(205) 评论(0) 推荐(0) 编辑
摘要: .fix{zoom:1;}.fix:after{display:block; content:''; clear:both; line-height:0; visibility:hidden;} 阅读全文
posted @ 2015-08-11 07:16 sunhaikuo 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Arr1.sort(function(){return Math.random()>0.5?-1:1;}); 阅读全文
posted @ 2015-08-01 17:29 sunhaikuo 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Math.floor(Math.random()*5) 阅读全文
posted @ 2015-07-22 11:04 sunhaikuo 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2015-07-10 17:41 sunhaikuo 阅读(281) 评论(0) 推荐(0) 编辑
摘要: vars="TheraininSpainfallsrainmainlyintherainplain";varreg=newRegExp("rain","g");alert(s.match(reg).length); 阅读全文
posted @ 2015-07-02 23:33 sunhaikuo 阅读(251) 评论(0) 推荐(0) 编辑
摘要: function stopMP(e) { if (!e) { e = window.event; } e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); }... 阅读全文
posted @ 2015-07-01 18:35 sunhaikuo 阅读(118) 评论(0) 推荐(0) 编辑
摘要: event.srcElement || event.target 阅读全文
posted @ 2015-06-29 18:22 sunhaikuo 阅读(102) 评论(0) 推荐(0) 编辑