File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,10 +123,13 @@ You can also extend jQuery to add a function that does it all for you:
123123
124124``` javascript
125125$ .fn .extend ({
126- animateCss : function (animationName ) {
126+ animateCss : function (animationName , callback ) {
127127 var animationEnd = ' webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend' ;
128128 this .addClass (' animated ' + animationName).one (animationEnd, function () {
129129 $ (this ).removeClass (' animated ' + animationName);
130+ if (callback) {
131+ callback ();
132+ }
130133 });
131134 return this ;
132135 }
@@ -137,6 +140,10 @@ And use it like this:
137140
138141``` javascript
139142$ (' #yourElement' ).animateCss (' bounce' );
143+ or
144+ $ (' #yourElement' ).animateCss (' bounce' , function () {
145+ // Do somthing after animation
146+ });
140147```
141148
142149You can change the duration of your animations, add a delay or change the number of times that it plays:
You can’t perform that action at this time.
0 commit comments