Advertisement
Mahfuz

jQuery Smooth Scroll activation code

Aug 16th, 2015
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1.  
  2. // jQuery smooth scroll
  3. $('.smooth-scroll').bind('click', function(event) {
  4. var $anchor = $(this);
  5. var headerH = '30';
  6. $('html, body').stop().animate({
  7. scrollTop : $($anchor.attr('href')).offset().top - headerH + "px"
  8. }, 1200, 'easeInOutExpo');
  9.  
  10. event.preventDefault();
  11. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement