Im using the following to scroll to the top of a page when you click a certain link.
$('.myLinkToTop').click(function () {
$('html, body').animate({scrollTop:0}, 'slow');
return false;
});
I want to make another link that scrolls to the bottom of the page. The following is working OK. I think it tries to scroll 1000px down the page, so if the page is shorter then it scrolls faster than it should, and if the page is taller then it wont go all the way to the bottom. How can I replace '1000' with the window height? Thanks
$('.myMenuLink').click(function () {
$('html, body').animate({scrollTop:1000}, 'slow');
return false;
});
I know that this code jumps to the bottom of the page, but it doenst scroll smoothly like I need:
$(document).scrollTop($(document).height());