• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.
    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript 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
Apr 19, 2019
407
184
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

Master Yoda

Administrator
Administrator
Verified
Jan 2, 2018
1,720
431
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 :)