Last active
December 13, 2015 18:18
-
-
Save rabellamy/4953720 to your computer and use it in GitHub Desktop.
Nice scroll
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
(function($){ | |
$(document).ready(function($){ | |
// Scroll from header to menu in footer for small-screen devices | |
$("#bye").click(function(event) { | |
event.preventDefault(); | |
var full_url = this.href; | |
var parts = full_url.split('#'); | |
var trgt = parts[1]; | |
var target_offset = $('#'+trgt).offset(); | |
var target_top = target_offset.top; | |
$('html, body').animate({scrollTop:target_top}, 1000); | |
}); | |
}); | |
})(jQuery); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment