My links are supposed to smoothly scroll to the bottom and top, but they're not working correctly even though I believe the JavaScript is functioning properly.
Here is the JavaScript code:
$.fn.ready(function() {
// Smooth scroll to top.
$("a[href=#top]").live("click", function(e) {
$("html,body").animate({scrollTop:0}, 1000);
e.preventDefault();
});
// Smooth scroll to bottom.
$("a[href=#bot]").live("click", function(e) {
$("html,body").animate({scrollTop:$(document).height()}, 1000);
e.preventDefault();
});
});
And here is the HTML code for the links:
<a href="#bot" id="botlink" title="Go to bottom">↓</a>
<a href="#top" id="toplink" title="Go to top">↑</a>