ex: $('yourElemID').setProperty('propName', className');
USE: element.setProperty('property-name', 'class-name' )
OR
element.addClass('class-name' ) & element.removeClass('class-
name' )
OR EVEN
element.className = 'class-name'
And you can have that class defined in your css file with what ever
rule you want to implement: height: something; width: something
On Oct 4, 1:42 pm, Rolf Langenhuijzen <[email protected]> wrote:
> What is the smartest way to dynamically create a css style/class that
> I can insert in the page an (re-)use?
>
> I'm working on some layout stuff that requires calculating & applying
> of width/height settings to elements, but I want to add additional
> styles for media queries/browser sizing and rather create some css
> classes on the fly when the script runs. Then add those classes to
> elements (or parent), rather than doing calculations all the time and
> adding width/height style properties.
>
> Cheers,
> Rolf