Created
February 27, 2013 22:41
-
-
Save tcelestino/5052527 to your computer and use it in GitHub Desktop.
Animate scrollTop using jQuery.
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
function scrollUp() { | |
var content_animate = $(jQuery.browser.webkit ? "body": "html"); // bug fix to animate on firefox and uses to opera and ie. | |
var _position = content_animate.scrollTop(); | |
if(_position > 0) { | |
content_animate.animate({ | |
scrollTop: 0 | |
}, 1500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment