Luca De Angelis
Luca De Angelis

Reputation: 227

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

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?

Upvotes: 1

Views: 2939

Answers (1)

Janne Aukia
Janne Aukia

Reputation: 1022

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

Upvotes: 1

Related Questions