Skip to content Skip to sidebar Skip to footer

How To Work With Multiple Css Properties?

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

Solution 1:

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){
     varval = x + " " + y;
     $(el).css({"-webkit-transform":val, "-moz-transform": val, "-webkit-transform": val, "-o-transform": val});
  }

Post a Comment for "How To Work With Multiple Css Properties?"