微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

query-mousewheel

编程之家收集整理的这个编程导航主要介绍了query-mousewheel编程之家,现在分享给大家,也给大家做个参考。

query-mousewheel 介绍

jQuery Mousewheel Plugin,用于添加跨浏览器的鼠标滚轮支持

mousewheel事件的处理函数有一点小小的变化,它除了第一个参数event 外,还接收到第二个参数delta。

通过参数delta可以获取鼠标滚轮的方向和速度。

如果delta的值是负的即-1,那么滚轮就是向下滚动,正的1就是向上。

js代码

// using bind

$('#my_elem').bind('mousewheel',function(event,delta,deltaX,deltaY) {

if (window.console && console.log) {

console.log(delta,deltaY);

}

});

// using the event helper

$('#my_elem').mousewheel(function(event,deltaY);

}

});

网站地址:https://github.com/jquery/jquery-mousewheel

GitHub:https://github.com/jquery/jquery-mousewheel

网站描述:一个用于添加跨浏览器的鼠标滚轮支持的 jQuery 插件

query-mousewheel

官方网站:https://github.com/jquery/jquery-mousewheel

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。