如果由 jQuery 设置,CSS3 2D 变换在 IE9 上不起作用 [英] CSS3 2D Transforms not working on IE9 if set by jQuery
问题描述
根据标题,我正在使用 CSS3 的变换来平移和旋转对象,它在除 IE9 之外的所有浏览器中都能完美运行.
As per title, I'm translating and rotating an object with CSS3's transform and it works flawlessly in every browser except IE9.
它适用于 IE9 但前提是它直接写入 .css 文件.如果由 jQuery (v. 1.5.1) 设置,则失败:
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%)');
有什么建议吗?
推荐答案
我不知道是什么导致了问题.但是,您是否尝试过使用 cssText:
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%)');
$('#example').css('cssText','-ms-transform: translate(200%) rotate(45deg) translate(-200%)');
有时这似乎可行.
我认为问题与这个 jQuery 问题有关:
I believe the problem is related to this jQuery issue:
http://bugs.jquery.com/ticket/8346
这篇关于如果由 jQuery 设置,CSS3 2D 变换在 IE9 上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!