How can i auto scroll to bottom of page with jquery becuase i am requesting xmlhttp to update content of page
A:
A javascript function like this will work... just set the vertical destination to be some ridiculous number like 50000. I just tested it and it works like a charm.
function jumpScroll() {
window.scroll(0,50000); // horizontal and vertical scroll targets
}
Brandon Jackson
2009-12-27 19:42:26
A:
function scroll(){
$('html, body').animate({
scrollTop: $("#footerOfPage").offset().top
}, 0);
}
awolf
2009-12-27 19:42:34
+7
A:
This will work in every case, no need to put a 'ridiculous' number in it:
$(document).scrollTop($(document).height());
Tatu Ulmanen
2009-12-27 19:43:30
Nice and simple.
gnarf
2009-12-27 19:47:44
A:
To cover all scenarios: Consider scrolling an overflowed div where height is not the same as scrollHeight. (remove the animate part if its not needed):
$('#myDiv').animate({
scrollTop: $('#myDiv').get(0).scrollHeight
}, 1500);
Gyuri Ambrozy
2010-01-05 10:51:48