Skip to content

Instantly share code, notes, and snippets.

@paullacey78
Last active December 13, 2017 15:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paullacey78/83e0e59485d580a0cae8d5f4229de7be to your computer and use it in GitHub Desktop.
Save paullacey78/83e0e59485d580a0cae8d5f4229de7be to your computer and use it in GitHub Desktop.
<script type="text/javascript">
// Make jQuery WP friendly
(function ($) {
// Initiate after document loads
$( document ).ready(function() {
// Custom function
jQuery('#content a').click(function(){
jQuery('html, body').animate({
scrollTop: jQuery( jQuery(this).attr('href') ).offset().top
}, 400);
return false;
});
});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment