jQuery's $.fn.one
is supposed to be turned off after an event had been fired, and the listener had run the script.
However, if it's listening to multiple events, it won't turn off for all listened events after one of them firing.
Using this event listener:
var transitionend = "webkitTransitionEnd msTransitionEnd transitionend";
$( "foo" ).one( transitionend , function(){
foo.bar();
} );
The foo.bar()
method will be executed 2 times in chrome, since webkitTransitionEnd
transitionend
both fire.
I am trying to achieve an elegant solution where firing one of the listened methods turns off all others in the listener.