4

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

Geert-Jan
  • 18,623
  • 16
  • 75
  • 137

1 Answers1

9

You can use the custom event only :

  $("#id").niceScroll().scrollstart(function(info){
      //do something here 
  })
  // or
  $("#id").niceScroll().scrollend(function(info){
      //do something here 
  })
joar
  • 15,077
  • 1
  • 29
  • 54
user2138339
  • 91
  • 1
  • 3