Usually I have a CSS file which has the following rule:
#my-window {
position: fixed;
z-index: 102;
display:none;
top:50%;
left:50%;
}
How can I avoid creating such a static CSS file by adding the CSS information during runtime actions to the body, or something similar? (only using jQuery)
I want to define it once but with jQuery and use it many times later; that's why I do not want to add it each time to the specific DOM elements.
I know the simple features (css("attr1", "value");
), but how can I create a complete reusable CSS rule?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…