Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Gábor Papp
Added: Aug 21, 2019 7:50 AM
Views: 18
Tags: no tags
  1.     $('a[href^="#"]').on('click', function(event) {
  2.         var target = $(this.getAttribute('href'));
  3.         if( target.length ) {
  4.             event.preventDefault();
  5.             $('html, body').stop().animate({
  6.                 scrollTop: target.offset().top-90
  7.             }, 1000);
  8.         }
  9.     });