Unlimited scroll-JQuery method to get event on bottom of scroll

Jak
Jak
Member
858 Points
132 Posts

Hi,

How to find the event on bottom of the scroll for concept of unlimited scroll in jquery?

Views: 8756
Total Answered: 2
Total Marked As Answer: 1
Posted On: 03-Jan-2015 15:21

Share:   fb twitter linkedin
Answers
NiceOne Team
NiceOne...
Editor
1382 Points
14 Posts
         

Hi, Rahul Maurya

You can use this:

$(window).scroll(function(){ 
if ($(window).scrollTop() == ($(document).height() - $(window).height())) {
alert('You are at Bottom');
}
});
 
Posted On: 04-Jan-2015 03:05
NiceOne Team
NiceOne...
Editor
1382 Points
14 Posts
         

You can also use following code: 

$(window).scroll(function () {
var wintop = $(window).scrollTop(), docheight = $(document).height(), winheight = $(window).height();
var scrolltrigger = .95;
if ((wintop / (docheight - winheight)) > scrolltrigger) {
GetMoreItems();
}
});

 

Posted On: 28-Jan-2015 08:30
 Log In to Chat