×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
1
Language: Javascript
Posted by: Nicole Patten
Added: Apr 13, 2016 4:33 PM
Views: 28
jquery smoothscroll
  1.         $('a[href^="#"]').on('click',function (e) {
  2.             e.preventDefault();
  3.  
  4.             var target = this.hash;
  5.             var $target = $(target);
  6.  
  7.             $('html, body').stop().animate({
  8.                 'scrollTop': $target.offset().top - 50
  9.             }, 900, 'swing');
  10.         });