I used the following to determine the end of a CSS3 transition, for example: -
CACHE.previewControlWrap.css({ 'bottom':'-217px' }).one('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd', function () { CACHE.songWrap.css({ 'bottom': '0' }); });
This works great, the CSS transition happens, and then when it completes, something else happens.
However, when I set this anonymous function to the third level, it does not work. The third end transition event is fired at the same time as the second, instead of binding them one by one (as happens with jQuery.animate ())
What I would like to do is bind the transition event to the 'specific' element. Currently, it seems to be looking for a transition event to any element and is triggering accordingly. If not, is there another workaround so that I can have three consecutive css transition events queued for all firing after completing the previous one.
Thanks in advance.
The following is the code causing the problem: -
if(Modernizr.csstransitions){ CACHE.leftcolbottom.css({ 'left':'-230px' }); CACHE.songwrap.css({ 'left':'100%', 'right': '-100%' }); CACHE.previewControlWrap.css({ 'bottom':'-217px' }).one('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd', function () { CACHE.songWrap.css({ 'bottom': '0' }); CACHE.middle.css({ 'bottom': '350px' }).one('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd', function () { CACHE.slidewrap.css({ 'left': '50%', 'right': '0%' }); CACHE.leftcoltop.css({ 'left': '0%' }); }); }); }
gordyr
source share