nucliweb
12/8/2014 - 1:15 PM

CSS Animation Events

CSS Animation Events

//---------------------------------------------------------------------------
// var anim = d.querySelector('.buy .fade-out'),
//	PrefixedEvent(anim, 'AnimationEnd', function(){
//		...
//	});
var pfx = ["webkit", "moz", "MS", "o", ""];
function PrefixedEvent(element, type, callback) {
	for (var p = 0; p < pfx.length; p++) {
		if (!pfx[p]) type = type.toLowerCase();
		element.addEventListener(pfx[p]+type, callback, false);
	}
}