sushma_proach

jquery for scroll up in footer

May 28th, 2016
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <script>
  2. jQuery(document).ready(function () {
  3.  
  4.     $(window).scroll(function () {
  5.         if ($(this).scrollTop() > 100) {
  6.             $('.scrollup').fadeIn();
  7.         } else {
  8.             $('.scrollup').fadeOut();
  9.         }
  10.     });
  11.  
  12.     $('.scrollup').click(function () {
  13.         $("html, body").animate({
  14.             scrollTop: 0
  15.         }, 600);
  16.         return false;
  17.     });
  18.  
  19. });
  20. </script>
  21. <style>
  22. .scrollup {
  23.     width: 45px;
  24.     height: 44px;
  25.     position: fixed;
  26.     bottom: 30px;
  27.     right: 140px;
  28.     text-indent: -9999px;
  29.     z-index:999;
  30.     background: url('http://jay.avadaagency.com/wp-content/uploads/2016/05/up.png') no-repeat;
  31.  
  32. }
  33. </style>
  34. <a href="#" class="scrollup">Scroll</a>
Add Comment
Please, Sign In to add comment