我正在使用jQuery custom content scroller在 div 元素上创建自定义滚动条。当在 div 内部滚动并到达 div 的底端时,页面将开始滚动。有没有办法阻止滚动事件传播?
我创建了一个http://jsfiddle.net/7CPv5/来说明问题。只需调整浏览器大小即可创建垂直滚动条并开始在“Hello World”div 内滚动。我这样调用插件:
$('#scrollable').mCustomScrollbar({
scrollInertia: 0
});
最佳答案
解决这个问题的不同方法:
$("#scrollable").mouseenter(function(){
$("#content-md").mCustomScrollbar("disable");
}).mouseleave(function(){
$("#content-md").mCustomScrollbar("update");
});
关于javascript - 防止 mCustomScrollbar 中的滚动事件传播,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21815546/