Created
December 3, 2013 02:54
-
-
Save simplelife7/7763195 to your computer and use it in GitHub Desktop.
【JS】判断动画animate是否结束函数
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
(function($){ | |
/** | |
* 绑定css3的animateend事件 | |
* @public | |
* @function | |
* @name $.fn.onAnimated | |
* @param {Function} cbk 事件处理函数 | |
*/ | |
$.fn.onAnimated = function (cbk) { | |
return this.each(function(){ | |
if (cbk === false) { | |
$(this).unbind("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd"); | |
return; | |
} | |
$(this).bind("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd",cbk); | |
}); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment