繁体   English   中英

延迟加载页面后执行操作

[英]Perform action after loading page with delay

我想显示一个div,但它必须显示页面何时完全加载,然后必须等待3秒钟。

所以:

  1. 载入页面...
  2. 页面已加载...
  3. 等待3秒...
  4. 执行动作。

我该怎么做呢?

目前这是我的代码:

jQuery(window).load(function () {
    $("#logoResize").attr('style', '-webkit-transform:scale(1.25); -moz-transform:scale(1.25); -ms-transform:scale(1.25); -o-transform:scale(1.25); transform:scale(1.25);');
});

使用setTimeout

jQuery(window).load(function () {
    setTimeout(function(){
        $("#logoResize").attr('style', '-webkit-transform:scale(1.25); -moz-transform:scale(1.25); -ms-transform:scale(1.25); -o-transform:scale(1.25); transform:scale(1.25);');
    }, 3000);
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM