I don’t know if this is possible but will try to explain what I need.
I want to do something like this ….
CSS class with undefined variables X,Y,Z:
.r {border-radius:Xpx;-webkit-border-radius:Ypx;-moz-border-radius:Zpx;}
Then in body:
<div id='test'></div>
Script:
$("#test").addClass("r(10,10,10)")
As you see I have a CSS class but there are no numbers. Just variables.
And I want to apply this class to element using jquery and send all variables through jquery.
Is there any way to do this ?
Interesting idea, but unfortunately not possible to implement directly: the CSS is “compiled” instantly so such CSS is just invalid and won’t be recognized.
Instead, what you can do is have such code:
To set the CSS properties on the fly with jQuery.