子元素scroll父元素容器不跟随滚动JS实现

1.dom.onmousewheel = function() {
    // js鼠标滑动事件
};
IE, Chrome都认识,但是FireFox浏览器,要使用DOMMouseScroll;
2.(e.wheelDelta)  //判断浏览器IE,谷歌滑轮事件 
(e.detail)    //Firefox滑轮事件
 当滑轮向上滚动时 大于0;
 当滑轮向下滚动时 小于0;

3.http://www.zhangxinxu.com/wordpress/2015/12/element-scroll-prevent-parent-element-scroll-js/ 来自张鑫旭实现代码;


posted @ 2015-12-25 15:42  张鑫鑫是好人  阅读(613)  评论(0编辑  收藏  举报