javascript - How to dynamically insert css vendor prefixes using jquery -
recently have been working css3 , animations. use following code @ 1 point:
$(".container").css('-webkit-transform', 'translate(200px,200px)');
now of wondering why dont use class above , toggle it.
well thing calculations , obtain 200px,200px , replace 200px,200px variable (i used 200px,200px example)
any ideas on can do
if i'm understanding question, want use variables translation outlined in above code. if have variables like:
var x = 200, y = 200;
you should able insert them translation string cutting , catenating them together. might like:
$(".container").css('-webkit-transform', 'translate('+x+'px,'+y+'px)');
Comments
Post a Comment