Skip to content

Instantly share code, notes, and snippets.

@mikeselander
Created March 15, 2016 04:09
Show Gist options
  • Save mikeselander/08258f63f932c45b6ed2 to your computer and use it in GitHub Desktop.
Save mikeselander/08258f63f932c45b6ed2 to your computer and use it in GitHub Desktop.
$( document ).ready( function (){
if ( window.innerWidth <= 700 && ! $( 'body' ).hasClass( 'front-page' ) ){
$( 'html, body' ).animate({
scrollTop: $( ".my-div" ).offset().top
}, 500 );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment