jQuery Scroll To bottom of the page
Solution 1:
You can just animate to scroll down the page by animating the scrollTop
property, no plugin required, like this:
$(window).load(function() {
$("html, body").animate({ scrollTop: $(document).height() }, 1000);
});
Note the use of window.onload
(when images are loaded...which occupy height) rather than document.ready
.
To be technically correct, you need to subtract the window's height, but the above works:
$("html, body").animate({ scrollTop: $(document).height()-$(window).height() });
To scroll to a particular ID, use its .scrollTop()
, like this:
$("html, body").animate({ scrollTop: $("#myID").scrollTop() }, 1000);
Solution 2:
something like this:
var $target = $('html,body');
$target.animate({scrollTop: $target.height()}, 1000);
Solution 3:
You can try this
var scroll=$('#scroll');
scroll.animate({scrollTop: scroll.prop("scrollHeight")});
Solution 4:
$('html,body').animate({ scrollTop: 9999 }, 'slow');
As simple as this , 9999 page height ... big range so it can reach to bottom .