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?
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?
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});
}
-moz-transform: scaleX(-1); -webkit-transform: scaleX(-1); -o-transform: scaleX(-1); -transform: scaleX(-1); and I want to add scaleY(-1) and then maybe to remove scaleX(-1), that means I'll have to write a class for every action and there is no way around?