yash-goli / jquery-nicescroll

Automatically exported from code.google.com/p/jquery-nicescroll
0 stars 0 forks source link

Detect scroll at bottom #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
My attempts:

myScroll = $("#mydiv").niceScroll();

myScroll.scrollend(function(){
    if(myScroll.getScrollTop()+myScroll.cursorheight >= myScroll.getContentSize().h) {
        // do something
    }
});
When the scroll at bottom, the cursorheight I got can't satisfy the condition, 
it's smaller than what I expected.
Can anyone explain what the cursorheight is, and tell me how to konw the scroll 
reaches the bottom of a div?

This is the data of the three properties I got from attempts:
getScrollTop() - cursorheight - getContentSize().h
33 - 337 - 400
433 - 168 - 800
833 - 112 - 1200

Original issue reported on code.google.com by huangyp1...@gmail.com on 18 Apr 2013 at 12:39

GoogleCodeExporter commented 9 years ago
I found the solution on github:

myScroll.scrollend(function(){
    if(myScroll.scrollvaluemax == myScroll.scroll.y) {
        // do something
    }
});

See: https://github.com/inuyaksa/jquery.nicescroll/issues/71

Original comment by huangyp1...@gmail.com on 19 Apr 2013 at 1:57

GoogleCodeExporter commented 9 years ago
Thank you, dude

Original comment by antho...@gmail.com on 25 May 2015 at 11:25