In an HTML document I've got some elements which need some javascript manipulations before showing up. To be more specific, their height and width must be adjusted based on user's window size.
The matter is that I want them appear already adjusted. The common way to adjust elements is to change their css properties via $(element).css()
function in $(document).ready()
, but, for many reasons, the execution of javascript may be delayed. This will cause the document display the wrong way first and then redraw correctly. To deal with that i'd like to change the classes of the elements before loading the elements.
Is there a way to directly operate with css classes, not with elements, in javascript and jquery? Editing inner html of <style>
seems wrong and awkward to me.