Scroll the page using javascript

26 views

scroll your page using scrollTop. This code will scroll your window with respect to top

  1. <script language=‘javascript’>
  2. function move_up() {
  3. document.body.scrollTop = 0;
  4. }
  5. </script>
  6. .
  7. .
  8. .
  9. .
  10. .
  11. .
  12. .
  13. .
  14. .
  15. .
  16. .
  17. .
  18. .
  19. .
  20. .
  21. .
  22. .
  23. .
  24. .
  25. .
  26. .
  27. .
  28.  
  29. <body>
  30. contents…
  31.  
  32. <a href="javascript:move_up()">top</a>
  33. </body>
  34.  



« jQuery ajax How to use fadeIn and fadeOut in jquery »
Posted on Monday, April 6th, 2009 at 3:04 pm under Javascript | RSS 2.0 Feed

Post Comment

You must be logged in to post a comment.



ComputerEducationWorld.com All Rights Reserved © RSS | CBSE | Education Boards Of India | What is My IP?