Last active
November 7, 2017 12:37
-
-
Save yuriitaran/f28aacea1fd81450ca5370ebb5bb7c18 to your computer and use it in GitHub Desktop.
JQuery scroll to specific position
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
$('html, body').animate({ | |
scrollTop: ($('.sroll-to-element').first().offset().top) | |
},500); | |
// Scroll to Main content | |
$( '.scroll-to-content' ).click(function() { | |
$('html, body').animate({ | |
scrollTop: ($('.homepage-main').first().offset().top) | |
},800); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment