开发者

Jquery Script pauses

Can anyone recommend th开发者_C百科e best way to pause a script until a second after page load?

Thanks paul


There are two approaches:

  1. setTimeout JS plain-and-simple JS standard.
  2. delay(n) jQuery method.

Both are explained here delay JQuery effects


I answered this a couple of days ago:

$(document).ready(function() {
    setTimeout(function() {
        ...  // put your body here
    }, 1000);
});


By enclosing your script inside the following jQuery code, execution will be delayed until after everything in your page has loaded:

$(function() {
  // your code goes here...
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜