Need help How do I display a div over a div then disappear after 10 seconds?

David

New Coder
Apr 1, 2019
19
15
4
I have a SWF file that I play on my website. But before this SWF plays, I want to play another SWF file before it. It's about 10 seconds. So I have a two DIVs: one containing the SWF file that I want to play before, and the other div to contain the SWF I want to present. I believe Jquery can be used to solve my problem. Can anyone help? I tried searching the internet but found no solution. Any help would be gladly appreciated! Thanks!
 

Ghost

Active Coder
Moderator
Apr 19, 2019
326
149
43
I don't have time to write the code right now, but you can use a setTimeout function to do something after 10 seconds...

JavaScript:
<div id="swf_box">
<!-- put your first swf embed html here to start-->
</div>


<script>

$(document).ready(function(){
    var secondSwfHTML = ""; // put your second SWF embed code in that variable
    
    // do something after 10 seconds:
    setTimeout(function(){
     $("#swf_box").html(secondSwfHTML); // this will replace first swf with second swf
    }, 10000);
    
    /* If you can't figure it out, hire us :)
    https://wubur.com
    Cheers!
    */
    
}); //document ready
</script>
 
  • Like
Reactions: TopSilver

Malcolm

Administrator
Administrator
Jan 2, 2018
1,015
277
95
Canada
codeforum.org
Awesome! Glad you figured it out, remember to select best answer!

If your answer didn't come from CodeForum perhaps share how you solved and the sources :)