Binding to Jquery Nicescroll events. Which events are available?

Geert-Jan picture Geert-Jan · Oct 29, 2012 · Viewed 8.1k times · Source

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

Answer

user2138339 picture user2138339 · Mar 6, 2013

You can use the custom event only :

  $("#id").niceScroll().scrollstart(function(info){
      //do something here 
  })
  // or
  $("#id").niceScroll().scrollend(function(info){
      //do something here 
  })