Return to Snippet

Revision: 35045
at November 1, 2010 19:31 by goo


Initial Code
<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>

Initial URL
http://www.devcurry.com/2010/10/use-jquery-to-scroll-to-bottom-or-top.html

Initial Description


Initial Title
Scroll down and top

Initial Tags
javascript

Initial Language
JavaScript