Reputation: 405
Here is my css code:
#pic-1 {
z-index: 1;
-webkit-transform: rotate(-10deg);
-moz-transform: rotate(-10deg);
-o-transform: rotate(-10deg);
transform: rotate(-10deg);
-ms-transform: rotate(-10deg);
filter: progid:DXImageTransform.Microsoft.Matrix(
M11=0.9848077530122081,
M12=0.17364817766692991,
M21=-0.17364817766692991,
M22=0.9848077530122081,
SizingMethod='auto expand');
}
I want to get the filter matrix M11 value from this class. In this case I tried:
console.log(document.getElementById("pic-1").filters.item(0).M11);
and several other variations, but I get nothing. Anybody knows how to get the M11 value from node n? Basically I need this to calculate the rotation in degrees in IE7.
Upvotes: 0
Views: 2857
Reputation: 6761
Check this link in IE- http://jsfiddle.net/qcgxR/2/
Script
object.filters.filters.item("DXImageTransform.Microsoft.Matrix").M11 = value;
Eg:-
document.getElementById("mydog").filters.item("DXImageTransform.Microsoft.Matrix").M11=.5;
Upvotes: 2
Reputation: 154908
You could fetch the property and match it against a regexp: http://jsfiddle.net/Hacv6/3/.
var filter = document.getElementById("pic-1").currentStyle.filter,
regexp = /M11=([^,]+),/,
match = filter.match(regexp);
alert(match[1]);
Upvotes: 1