摘要:
得到文档内容的宽度和高度function getElementport(){ if(document.compatMode=="BackCompat"){ return { width:Math.max(document.body.scrollWidth,document.body.clientWidth), height:Math.max(document.body.scrollHeight,document.body.clientHeight) } }else{ return { width:Math.max(document.documentElement.scrol 阅读全文
摘要:
对于滚动有两种事件1就是滚动事件,2就是滚轮事件,下面是两者区别滚动事件 监听方法onscroll,(火狐是去掉on),意思是当元素出现滚动条,并且滚动滚动条时,才会触发,不管是通过滚轮,还是直接拉的滚动条滚轮事件 监听方法:ie和火狐不同 ie是scrollwheel,火狐是DOMMouseScroll 可以写一个兼容函数function wheel_event(elem,func){ if(elem.attachEvent){ elem.attachEvent("onmousewheel",func); }else if(elem.addEventListener... 阅读全文