Scroll vertical lento jquery


/ Published in: jQuery
Save to your folder(s)

Esto permite hacer un suave scroll hacia el top de la página.


Copy this code and paste it in your HTML
  1. $('#toTop').click(function(){
  2. $('html, body').animate({scrollTop:0}, 'slow');
  3. return false;
  4. });
  5.  
  6. $(window).scroll(function(){
  7. if ($(window).scrollTop() > 0) $('#toTop').fadeIn('fast', function(){});
  8. if ($(window).scrollTop() == 0) $('#toTop').fadeOut('fast', function(){});
  9. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.