Ramirez
Ramirez

Reputation: 193

jQuery how to declare filter code with .css method

I was wondering how to solve the next problem: I have a div that is rotated (315) degrees. Since IE8 does not supports transform property, I can apply the following filter in my stylesheet file:

 filter: "progid: DXImageTransform.Microsoft.Matrix (M11 = 0.70710678, 0.70710678 = M12,    M21 = -0.70710678, M22 = 0.70710678, sizingMethod = 'auto expand')"; 

But I want to solve this with jQuery with the following piece of code:

if (! jQuery.support.leadingWhitespace) {
 // Write your code for IE7 and IE8 browsers
 $ ('div.rotatedspan).css ({
     'filter': 'ProgID: DXImageTransform.Microsoft.Matrix (M11 = 0.70710678, 0.70710678 = M12, M21 = -0.70710678, M22 = 0.70710678, sizingMethod ='auto expand')
 });
} 

But the page stumbles over this section ('auto expand), so the comma's around auto expand. Does anyone know how to declare sizingmethod on a correct way within a CSS method?

Upvotes: 0

Views: 72

Answers (1)

Rohan Kumar
Rohan Kumar

Reputation: 40639

Try this,

$('div.rotatedspan').css ({
 'filter': 'ProgID: DXImageTransform.Microsoft.Matrix (M11 = 0.70710678, 0.70710678 = M12, M21 = -0.70710678, M22 = 0.70710678, sizingMethod ="auto expand"')
});

Upvotes: 2

Related Questions