Based on the answer of Darthenius and Clay Lenhart Blog , I finally decided for this solution:
private native void registerAnimationEndHandler(final Element pElement, final CbAnimationEndHandlerIF pHandler) /*-{ var callback = function(){ pHandler.@fully.qualified.CbAnimationEndHandlerIF ::onAnimationEnd()(); } if (navigator.userAgent.indexOf('MSIE') < 0) { // no MSIE support pElement.addEventListener("webkitAnimationEnd", callback, false); // Webkit pElement.addEventListener("animationend", callback, false); // Mozilla } }-*/;
CbAnimationEndHandlerIF is the simple EventHandler user interface:
public interface CbAnimationEndHandlerIF extends EventHandler { void onAnimationEnd(); }
It works like a charm! Thanks Dartenius!
If anyone can notice a weakness in this, I will of course be happy to know.
Thomas jensen
source share