Sha256: fb92682bbbbe10a65c6ce557bdd1944633f6c11300cf67534b82041269364286
Contents?: true
Size: 1.12 KB
Versions: 44
Compression:
Stored size: 1.12 KB
Contents
var AnimationMixin = { /** * Flips element wrt vertical axis * @param node DOM node * @param startDeg * @param endDeg * @param ccw true if animated in ccw direction * @param callback called at the end of the animation */ flipY: function(node, startDeg, endDeg, ccw, callback) { var self = this; this.ny = startDeg; if(this.rotYINT) { clearInterval(this.rotYINT); } function rotate() { if(ccw) { self.ny -= 5; } else { self.ny += 5; } node.style.transform="rotateY(" + self.ny + "deg)"; node.style.webkitTransform="rotateY(" + self.ny + "deg)"; node.style.OTransform="rotateY(" + self.ny + "deg)"; node.style.MozTransform="rotateY(" + self.ny + "deg)"; if (self.ny === endDeg) { clearInterval(self.rotYINT); if(callback) { callback(); } } } this.rotYINT = setInterval(rotate, 4); } }; module.exports = AnimationMixin;
Version data entries
44 entries across 44 versions & 1 rubygems