Last active
March 9, 2017 06:31
-
-
Save mustafix/6f2f5fd846e9829b922a017fcff91f59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('.main_menu ul li a[href^="#"]').on('click',function (e) { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | |
&& location.hostname == this.hostname) { | |
var $target = $(this.hash); | |
$target = $target.length && $target | |
|| $('[name=' + this.hash.slice(1) +']'); | |
if ($target.length) { | |
var targetOffset = $target.offset().top; | |
$('html,body') | |
.animate({scrollTop: targetOffset}, 1000); | |
return false; | |
}} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment