Last active
November 1, 2017 14:23
-
-
Save griiettner/6798961 to your computer and use it in GitHub Desktop.
Bootstrap Smooth Scroll to Anchor
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
!function ($) { | |
$(function(){ | |
$('#home, #me, #footer').carousel({}); | |
var $root = $('html, body'); | |
$('a').click(function() { | |
var href = $.attr(this, 'href'); | |
$root.animate({ | |
scrollTop: $(href).offset().top | |
}, 500, function () { | |
window.location.hash = href; | |
}); | |
return false; | |
}); | |
}) | |
}(window.jQuery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
stop margin-top 100px ?