jquery - Transition End Fallback for ie9 -


i'm using following code jquery trigger events on transitionend , avoid multiple callback/support multiple browsers:

function whichtransitionevent(){     var t;     var el = document.createelement('fakeelement');     var transitions = {       'transition':'transitionend',       'otransition':'otransitionend',       'moztransition':'transitionend',       'webkittransition':'webkittransitionend'     }      for(t in transitions){         if( el.style[t] !== undefined ){             return transitions[t];         }     } } 

(code found here: http://davidwalsh.name/css-animation-callback)

however, seems ie9 doesn't support transitionend regardless of prefix/syntax. how set fallback ie9 when i'm using in scenario following (to remove loading screen dom after animation complete)?

$('#loading').one(transitionevent, function(event) {       $('#loading').remove(); }); 

i've seen several answers how prevent multiple callbacks using similar function 1 @ top of post, not understanding how create fallback. help!

var transitionevent = whichtransitionevent();  // bind event $('#loading').one(transitionevent, function(event) {   $('#loading').remove(); });  // if event not supported e.g. ie <= 9 if (! transitionevent) {   $('#loading').trigger(transitionevent); } 

the function returns falsy value (undefined), if event not supported.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -