Skip to content

Instantly share code, notes, and snippets.

@cherihung
Last active December 20, 2015 09:40
Show Gist options
  • Save cherihung/6109779 to your computer and use it in GitHub Desktop.
Save cherihung/6109779 to your computer and use it in GitHub Desktop.
smooth scroll using jquery. a sample snippet that targets one defined href.
jQuery(document).ready(function(){
var dpost = jQuery('#calloutpos').offset().top;
jQuery('#bottomslide').click(function(){
jQuery('html, body').animate({scrollTop:dpos}, 'slow');
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment