Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 25th, 2013  |  syntax: None  |  size: 3.09 KB  |  views: 104  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript">
  2. $(document).ready(function() {
  3.  
  4.     $('.scrollup').click(function(){
  5.     $("html, body").animate({ scrollTop: target_top }, 600);
  6.     return false;
  7.     });
  8.  
  9. });
  10. </script>
  11.  
  12. </head>
  13.  
  14. <body id="top">
  15.        
  16. <td><a href="#top" class="scrollup">Back to Top</a></td>
  17.        
  18. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  19. <html xmlns="http://www.w3.org/1999/xhtml">
  20. <head>
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  22. <title>Home</title>
  23. <link href="style.css" rel="stylesheet" type="text/css" />
  24. <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>
  25.  
  26. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript">
  27. $(document).ready(function() {
  28.  
  29.     $('.scrollup').click(function(){
  30.     $("html, body").animate({ scrollTop: 0 }, 600);
  31.     return false;
  32.     });
  33.  
  34. });
  35. </script>
  36.  
  37. </head>
  38.  
  39. <body id="top">
  40. <div id="header">
  41.     <div class="container">
  42.       <div id="title">Name</div>
  43.         <div id="tagline">Web Designer + Programmer</div>
  44.       <div id="navbar">
  45.             <table>
  46.                 <tbody>
  47.                     <tr>
  48.                         <td><a href="#services">Services</a></td><td><a href="#about">About</a></td><td><a href="#contact">Contact</a></td>
  49.                     </tr>
  50.                 </tbody>
  51.             </table>
  52.         </div>
  53.     </div>
  54. </div>
  55.  
  56. <div id="services">
  57.     <div class="container">
  58.         <div id="servicescontent"></div>
  59.     </div>
  60. </div>
  61.  
  62. <div id="about">
  63.     <div class="container">
  64.         <div id="aboutcontent"></div>
  65.     </div>
  66. </div>
  67.  
  68. <div id="services2">
  69.     <div class="container">
  70.         <div id="services2content"></div>
  71.     </div>
  72. </div>
  73.  
  74. <div id="contact">
  75.     <div class="container">
  76.         <div id="contactinfo"></div>
  77.     </div>
  78. </div>
  79.  
  80. <div id="footer">
  81.     <div class="container">
  82.         <div id="copyright">Copyright 2013</div>
  83.         <div id="footernavbar">
  84.             <table style="font-size: 16px;">
  85.                 <tbody>
  86.                     <tr>
  87.                         <td><a href="#about">About</a></td><td><a href="#services">Services</a></td><td><a href="#top" class="scrollup">Back to Top</a></td>
  88.                     </tr>
  89.                 </tbody>
  90.             </table>
  91.         </div></div>
  92.     </div>
  93. </div>
  94.  
  95. </body>
  96. </html>
  97.        
  98. <!DOCTYPE html>
  99. <html>
  100. <head>
  101.     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
  102.     <script type="text/javascript">
  103.         $(document).ready(function() {
  104.                 $('.scrollup').click(function(event){
  105.                     event.preventDefault();
  106.                     $("html, body").animate({ scrollTop: 0 }, 600);
  107.                 });
  108.         });
  109.     </script>
  110. </head>
  111. <body id="top">
  112.  
  113.     <div style="height: 900px">
  114.         Some content
  115.     </div>
  116.     <div>
  117.         <a href="#" class="scrollup">go to top</a>
  118.     </div>
  119. </body>
  120. </html>
  121.        
  122. $("html, body").animate({ scrollTop: 0 }, "slow");