摘要: function preventDefault(ev){ ev=ev||window.event; if (ev.preventDefault){ ev.preventDefault(); } else { ev.returnValue = false; } }; 阅读全文
posted @ 2017-01-05 12:28 七月的微风 阅读(122) 评论(0) 推荐(0)
摘要: color:red; /* For IE8+ */*color:red; /* For IE7 and earlier */ _color:red; /* For IE6 and earlier */ 阅读全文
posted @ 2017-01-05 12:08 七月的微风 阅读(70) 评论(0) 推荐(0)
摘要: <style> .wrap{width:1200px;height:800px;border:1px solid #ccc;margin:50px auto;} .box{width:1200px;height:800px;display:table-cell;vertical-align: mid 阅读全文
posted @ 2017-01-05 11:56 七月的微风 阅读(132) 评论(0) 推荐(0)
摘要: 优点:节省内存,减少事件注册;当新增子对象时无需再次对其绑定事件。 例子: 阅读全文
posted @ 2017-01-05 11:34 七月的微风 阅读(107) 评论(0) 推荐(0)
摘要: //事件监听 function addEvent(obj,ev,fn){ if(obj.attachEvent){ obj.attachEvent(‘on’+ev,fn); //IE }else{ obj.addEventListener(ev,fn,false) //W3C } }; //解除事件 阅读全文
posted @ 2017-01-05 11:00 七月的微风 阅读(315) 评论(0) 推荐(0)