html:
<link id="mystylesheet" href="/path/to/css.css" />
code:
$("#mystylesheet").load(function(){
//Your javascript
}).attr("href", "/new/path/to/css.css");
This will replace your current CSS, and execute any code within the .load()
handler after the new CSS file has been fetched.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…