How can i auto scroll to bottom of page with jquery becuase i am requesting xmlhttp to update content of page
How can i auto scroll to bottom of page with jquery becuase i am requesting xmlhttp to update content of page
This will work in every case, no need to put a 'ridiculous' number in it:
$(document).scrollTop($(document).height());
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);
This Code work for me:-
jQuery("html, body").animate({ scrollTop: jQuery(window).height()}, 1500);
function scroll(){
$('html, body').animate({
scrollTop: $("#footerOfPage").offset().top
}, 0);
}