I am getting
-moz-transform: translate(-283.589px, 0px)
element.style[vendor + 'Transform']
matrix(1, 0, 0, 1, -283.589px, 0px)
I've got good news and bad news.
I'll start with the bad news: After examining the object that jQuery returns, the
matrix object is nothing but a string and there's absolutely no way you can get another object but a string. As much we would like to disagree that it shouldn't be a string: CSS values are strings, hence jQuery returns strings.
So, whether you like it or not, you really have to parse the string in order to get the value. The good news is: I've got two solutions.
Now, if you're VERY sure that the first couple of values are ALWAYS the same you could simply use substring. But, next problem: in Google Chrome, the value
-283.589px is being changed to
Honestly, you need a more advanced string parser to get the correct value. I welcome regular expression:
var matrix = $('.selector').css('-moz-transform'); var values = matrix.match(/-?[\d\.]+/g);
This gets all the values of your string.
By selecting the right index, you can get your value:
var x = values;
That's the best solution I can provide and I'm positive it's the only possible solution.