本文介绍了jquery 23秒延迟更改div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < script type =text / javascript> 
var flashvars = {};
flashvars.xml =config.xml;
flashvars.font =font.swf;
var attributes = {};
attributes.wmode =transparent;
attributes.id =滑块;
swfobject.embedSWF(cu3er.swf,cu3er-container,960,400,9,expressInstall.swf,flashvars,attributes);
< / script>

我希望更改 cu3er.swf 到 a.swf 我已经在 23秒之后使用 jQuery 。我怎么能这样做?

 < script type =text / javascript> 
swfobject.embedSWF(printmachine.swf,cu3er-container,960,400,9,expressInstall.swf,flashvars,attributes);
< / script>

谢谢

解决方案 div>

它并不是真正的jQuery特有的,你需要的是使用

 < script type =text / javascript> 
//您的代码...
swfobject.embedSWF(cu3er.swf,cu3er-container,/*...*/);
$ b $ setTimeout(function(){
jQuery('#cu3er-container')。empty(); //如果swfobject在插入前没有清除div,可能不需要
swfobject.embedSWF(printmachine.swf,cu3er-container,960,400,9,expressInstall.swf,flashvars,attributes);
},23000 ); //数字以毫秒为单位,所以23 * 1000为23秒
< / script>


I implemented my Cub3r like this

<script type="text/javascript">
            var flashvars = {};
            flashvars.xml = "config.xml";
            flashvars.font = "font.swf";
            var attributes = {};
            attributes.wmode = "transparent";
            attributes.id = "slider";
            swfobject.embedSWF("cu3er.swf", "cu3er-container", "960", "400", "9", "expressInstall.swf", flashvars, attributes);
    </script>

And I wish to change the cu3er.swf to a.swf i have made after 23 seconds using jQuery. How could I do this ?

<script type="text/javascript">
            swfobject.embedSWF("printmachine.swf", "cu3er-container", "960", "400", "9", "expressInstall.swf", flashvars, attributes);
</script>

Thanks

解决方案

It is not really jQuery specific, what you need is to use setTimeout

<script type="text/javascript">
// your code ...
swfobject.embedSWF("cu3er.swf", "cu3er-container", /*...*/);

setTimeout(function() {
  jQuery('#cu3er-container').empty(); // in case swfobject doesn't clean the div before inserting, might not be needed
  swfobject.embedSWF("printmachine.swf", "cu3er-container", "960", "400", "9", "expressInstall.swf", flashvars, attributes);
}, 23000); // the number is in millisecond, so 23 * 1000 for 23 seconds
</script>

这篇关于jquery 23秒延迟更改div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 15:55