开发者

Page fully re-rendered event?

I'm altering the DOM tree in plain JS and need to know when the changes get fully rendered on screen (mostly care about document dimensions).

window.onload=function(){
    ss = document.styleSheets[0];
    for(i = 0; i < ss.cssRules.le开发者_如何学JAVAngth; i++) { ss.deleteRule(i) };
    ss.addRule('p', 'color: red;')
    // ... many more
    // call some other function when the page is fully rendered?
}

TIA.


why don't use jQuery ? it provides that functionality and can help you a lot.


MyLibrary (i.e. your library) provides a documentready listener:

http://www.cinsoft.net/mylib-doc.asp#attachdocumentreadylistener >


Have settled on

window.setTimeout(function(){
// code
}, 50);

so far.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜