/ Published in: JavaScript
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Scroll to Bottom or Top - DevCurry.com</title>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js">
</script>
<script type="text/javascript" language="javascript">
$(function () {
$('#scrlBotm').click(function () {
$('html, body').animate({
scrollTop: $(document).height()
},
1500);
return false;
});
$('#scrlTop').click(function () {
$('html, body').animate({
scrollTop: '0px'
},
1500);
return false;
});
});
</script>
</head>
<body>
<a id="scrlBotm" href="#">Scroll to Bottom</a>
<div style="height:1000px"></div>
<a id="scrlTop" href="#">Scroll to Top</a>
</body>
</html>
URL: http://www.devcurry.com/2010/10/use-jquery-to-scroll-to-bottom-or-top.html
Comments
 Subscribe to comments
                    Subscribe to comments
                
                