animation - Why this jquery animate on css transform don't work in Opera -
i have plugin css property , animation transform rotatex , don't work in opera. know why?
// css rotatex transformation plugin (function($) { function gettransformproperty(element) { var properties = ['transform', 'webkittransform', 'moztransform', 'mstransform', 'otransform']; var p; while (p = properties.shift()) { if (element.style[p] !== undefined) { return p; } } return false; } var property = gettransformproperty(document.createelement('div')); if (property) { $.csshooks['rotatex'] = { get: function(elem, computed, extra){ return elem.style[property].replace(/.*rotatex\((.*)deg\).*/, '$1'); }, set: function(elem, value){ value = parseint(value); $(elem).data('roatex', value); if (elem.style[property].match(/rotatex/)) { var rotation = value == 0 ? '' : 'rotatex(' + value%360 + 'deg)'; elem.style[property] = elem.style[property].replace(/rotatex\([0-9]+deg\)/, rotation); } else { elem.style[property] += 'rotatex(' + value%360 + 'deg)'; } } }; $.fx.step['rotatex'] = function(fx){ $.csshooks['rotatex'].set(fx.elem, fx.now); }; } })(jquery);
it seams gettransformproperty return first value array.
jsfiddle. (rotation should change on click).
the rotatex 3d transform not supported opera. (tested in opera 12.15).
Comments
Post a Comment