Created
June 27, 2017 06:46
-
-
Save eksana/2836f8db597ba0959a05a33634405482 to your computer and use it in GitHub Desktop.
скролл к якорю
This file contains 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
$(document).ready(function() { | |
$('a[href^="#"]').click(function () { | |
elementClick = $(this).attr("href"); | |
destination = $(elementClick).offset().top; | |
if($.browser.safari){ | |
$('body').animate( { scrollTop: destination }, 1100 ); | |
}else{ | |
$('html').animate( { scrollTop: destination }, 1100 ); | |
} | |
return false; | |
}); | |
}); | |
//http://coding.dp.ua/jquery/1889-plavnyiy-perehod-k-yakoryu-iz-ssyilki.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://coding.dp.ua/jquery/1889-plavnyiy-perehod-k-yakoryu-iz-ssyilki.html