Created
December 13, 2013 19:19
-
-
Save brycejacobson/7949658 to your computer and use it in GitHub Desktop.
Smooth scroll to an id and trigger Cycle2 slide change.
This file contains hidden or 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
<a href="#slide-rio-medley" data-target="slider"></a> | |
<div id="slider"></div> |
This file contains hidden or 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
jQuery( '.rice a' ).on('click', function($) { | |
var target = "#" + jQuery(this).data('target'); | |
jQuery('html, body').animate({ | |
scrollTop: jQuery(target).offset().top -200 | |
}, 1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment