Sivakumar M R
Sivakumar M R

Reputation: 1

Nicescroll jquery scrollend function not working. Getting as undefined. Using beat version jquery only

$(document).ready(function() {
  // var nice = $("html").niceScroll();  // The document page (body)
  var scroll_var = $(".panel").niceScroll({ 
          cursorborder:"",
          cursorcolor:"#00F",
          boxzoom:true
  });

  scroll_var.scrollend(function(){

  });

});

Getting scrollend is undefined.

Upvotes: 0

Views: 1393

Answers (2)

Jamel Nytsee
Jamel Nytsee

Reputation: 1

You only have to pass "info" as parameter it will returns an object with x,y current position and also the event scroll ends

$(".panel").onscrollend = function(info) {
          console.log("Scroll end")
          console.log(info)
}

Upvotes: 0

Rob Grant
Rob Grant

Reputation: 7358

I'm not sure if you can even access that function. Try:

$(document).ready(function() {
  $(".panel").niceScroll({ 
          cursorborder:"",
          cursorcolor:"#00F",
          boxzoom:true
  });

  $(".panel").getNiceScroll().scrollend(function(){

  });

});

Upvotes: 0

Related Questions