Created
February 12, 2015 03:44
-
-
Save jp-resource/1b1b6e81deb50e12b0f2 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
var scrollToElement = function(el, ms){ | |
var speed = (ms) ? ms : 600; | |
$('html,body').animate({ | |
scrollTop: $(el).offset().top | |
}, speed); | |
} | |
// specify id of element and optional scroll speed as arguments | |
scrollToElement('#timeindicatordiv', 600); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment