Gee*_*Jan 4 jquery scroll jquery-plugins nicescroll
我正在使用Nicescroll并希望绑定到div的滚动事件,nicescroll-plugin被定义.
有点像:
$("#sec_menu").niceScroll();
$("#sec_menu").scroll(function(e){ //do stuff here });
Run Code Online (Sandbox Code Playgroud)
但是上述方法不起作用.我可以绑定哪个事件(可能是由nicescroll定义的自定义事件)在滚动时触发?我似乎无法在文档中找到任何内容.
谢谢
小智 8
您只能使用自定义事件:
$("#id").niceScroll().scrollstart(function(info){
//do something here
})
// or
$("#id").niceScroll().scrollend(function(info){
//do something here
})
Run Code Online (Sandbox Code Playgroud)