Created
January 7, 2013 19:47
-
-
Save anonymous/4477799 to your computer and use it in GitHub Desktop.
Create a Smooth Scrolling Effect for your Page Sections in Breezi
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
<!-- smooth scrolling script --> | |
<script> | |
$(function () { | |
$('a[href^="#"]').click(function(event) { | |
var id = $(this).attr("href"); | |
var offset = 20; | |
var target = $(id).offset().top - offset; | |
$('html, body').animate({scrollTop:target}, 500); | |
event.preventDefault(); | |
}); | |
}); | |
</script> | |
<!-- end smooth scrolling script --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment