Posted By

muslov1 on 08/19/10


Tagged

scroll


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dubogii


smooth scroll


 / Published in: jQuery
 

  1. /* Smooth Scroll
  2.  
  3. ========================================== */
  4.  
  5. $(function(){
  6.  
  7. $('a[href^=#]:not(a[href$=#]):not(#topInformation ul.navi li a)').click(function(){
  8.  
  9. var href= this.hash;
  10.  
  11. var $target = $(href == '#_top' ? 'body' : href);
  12.  
  13.  
  14. if($target.size()){
  15.  
  16. var top = $target.offset().top;
  17.  
  18. $($.browser.safari ? 'body' : 'html').animate({scrollTop:top}, 500, 'swing');
  19.  
  20. }
  21.  
  22. return false;
  23.  
  24. });
  25.  
  26. });

Report this snippet  

You need to login to post a comment.