Last active
December 20, 2015 20:59
-
-
Save mircobabini/6194557 to your computer and use it in GitHub Desktop.
jQuery AnimateTo Plugin - $.animateto (identifier, speed, easing, callback);
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 AnimateTo Plugin | |
| * | |
| * Copyright 2012, Mirco Babini | |
| * Dual licensed under the MIT or GPL Version 2 licenses. | |
| * http://www.opensource.org/licenses/mit-license.php | |
| * http://www.opensource.org/licenses/GPL-2.0 | |
| */ | |
| (function($) { | |
| $.animateto = function (identifier, speed, easing, callback, offset) { | |
| if (offset === undefined) offset = 0; | |
| return $('html,body').animate ({ scrollTop: $(identifier).offset ().top }, speed, easing, callback); | |
| }; | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment