Posted By

n19ht on 07/28/11


Tagged

scroll jquery slow lento


Versions (?)

Scroll vertical lento jquery


 / Published in: jQuery
 

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

  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  

You need to login to post a comment.