Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binding to Jquery Nicescroll events. Which events are available?

I'm using Nicescroll and want to bind to a scroll event of the div the nicescroll-plugin is defined on.

Somehting like:

$("#sec_menu").niceScroll();  
$("#sec_menu").scroll(function(e){   //do stuff here });

However the above doesn't work. Which event (perhaps a custom event defined by nicescroll) can I bind to that is fired on scrolling? I can't seem to find anything in the docs.

Thanks

like image 724
Geert-Jan Avatar asked Jan 15 '23 04:01

Geert-Jan


1 Answers

You can use the custom event only :

  $("#id").niceScroll().scrollstart(function(info){
      //do something here 
  })
  // or
  $("#id").niceScroll().scrollend(function(info){
      //do something here 
  })
like image 160
user2138339 Avatar answered Jan 30 '23 20:01

user2138339