DOMMouseScroll,onmousewheel 鼠标滚动事件js
来源:互联网 发布:siesta软件 编辑:程序博客网 时间:2024/04/29 04:55
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> div[class^='div'] { font-family: "微软雅黑"; font-size: 40px; height: 540px; border-bottom: solid 1px paleturquoise; } .div0 { background-color: #ff0; } .div1 { background-color: royalblue; } .div3 { background-color: cornflowerblue; } .div4 { background-color: blueviolet; } </style> </head> <body> <div class="div0">div0</div> <div class="div1">div1</div> <div class="div2">div2</div> <div class="div3">div3</div> <div class="div4">div4</div> </body> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript"> //判断是否是火狐浏览器 var IsFirefox = navigator.userAgent.toLocaleLowerCase().indexOf('firefox') > -1 $(function() { //添加鼠标滚动的监听事件 if(IsFirefox) { document.body.addEventListener('DOMMouseScroll', function(event) { console.log(event.detail); //向上滚动为120,向下是-120 }) } else { document.body.onmousewheel = function() { console.log(event.wheelDelta); //向上滚动为120,向下是-120 }; } }) </script></html>
0 0
- DOMMouseScroll,onmousewheel 鼠标滚动事件js
- 鼠标滚动事件mousewheel(DOMMouseScroll)
- js鼠标滚轮事件(mousewheel/DOMMouseScroll)
- js鼠标滚轮事件(mousewheel/DOMMouseScroll)
- js onmousewheel事件
- JS滚轮事件onmousewheel
- js鼠标滚动事件
- js鼠标滚动事件
- js鼠标滚动事件
- HTML中鼠标滚轮事件onmousewheel
- HTML中鼠标滚轮事件onmousewheel处理
- HTML中鼠标滚轮事件onmousewheel处理
- HTML中鼠标滚轮事件onmousewheel
- onmousewheel鼠标滚轮事件绑定的兼容性问题
- MFC鼠标事件-OnMouseMove移动OnMouseWheel缩放
- 关于浏览器兼容的问题以及字符串编码的一个坑,鼠标滚动事件mousewheel和DOMMouseScroll
- JS滚轮事件(mousewheel/DOMMouseScroll)了解
- JS滚轮事件(mousewheel/DOMMouseScroll)了解
- Zookeeper会话
- ORA-29913、ORA-30653错误
- 图片上传下载注意+下拉条多选
- WPF 如何对TextBox中输入的内容进行验证?
- 关于本人百度空间的文章迁移
- DOMMouseScroll,onmousewheel 鼠标滚动事件js
- 权限管理系统数据库设计的简单构思
- 飞机大战(下篇:逻辑)
- 简单搜索中坐标的遍历
- AspNet Identity 和 Owin 谁是谁
- 鸟哥的linux私房菜读书笔记0
- MYSQL explain详解
- Redis学习与实践日记(二)使用redis工具
- 反转链表后,输出链表的所有元素。