CSS3 2D Transforms not working on IE9 if set by jQuery

北城以北 提交于 2020-01-16 03:24:10

问题


As per title, I'm translating and rotating an object with CSS3's transform and it works flawlessly in every browser except IE9.

It works in IE9 but only if it's written directly into the .css file. It fails if set by jQuery (v. 1.5.1) with:

$('#example').css('-ms-transform', 'translate(200%) rotate(45deg) translate(-200%)');

Any suggestion?


回答1:


I don't know what is causing the problem. However, have you tried with cssText:

$('#example').css('cssText','-ms-transform: translate(200%) rotate(45deg) translate(-200%)');

Sometimes this would seem to work.

EDIT: I believe the problem is related to this jQuery issue:

http://bugs.jquery.com/ticket/8346



来源:https://stackoverflow.com/questions/5430809/css3-2d-transforms-not-working-on-ie9-if-set-by-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!