tags:

views:

773

answers:

5

How can i auto scroll to bottom of page with jquery becuase i am requesting xmlhttp to update content of page

+1  A: 

Try the ScrollTo plugin

fsb
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
}

[This is where I got it from]

Brandon Jackson
A: 
function scroll(){
  $('html, body').animate({
    scrollTop: $("#footerOfPage").offset().top
  }, 0);
}
awolf
+7  A: 

This will work in every case, no need to put a 'ridiculous' number in it:

$(document).scrollTop($(document).height());
Tatu Ulmanen
Nice and simple.
gnarf
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