Reputation: 1064
Is it possible to work with CSS properties?
For instance:
-webkit-transform: scaleX(-1) scaleY(-1)
Can I easily remove scaleX(-1) or add something new, without rewriting the whole -webkit-transform or changing classes?
Upvotes: 2
Views: 1273
Reputation: 24886
That css property takes two arguments. Therefore you cannot change one without touching the other. But this should be all you need to do:
$("#your-element").css("-webkit-transform","scaleX(-1) scaleY(-1)");
Edit
function changeTransform(el, x,y){
var val = x + " " + y;
$(el).css({"-webkit-transform":val, "-moz-transform": val, "-webkit-transform": val, "-o-transform": val});
}
Upvotes: 1