-
-
Save iblh/2b9480040525e0b84ff54eefc04b3a4f 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.topLink").click(function() { | |
$("html, body").animate({ | |
scrollTop: $($(this).attr("href")).offset().top + "px" | |
}, { | |
duration: 500, | |
easing: "swing" | |
}); | |
return false; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment