hide div and show iframe with countdown using javascript

后端 未结 1 834
悲&欢浪女
悲&欢浪女 2021-01-24 22:20

When the page load this iframe class=\"frame_src\" must be hidden like, display=\"none\"

And after 10 seconds this div must hide class=\"

相关标签:
1条回答
  • 2021-01-24 23:16

    OK, you have to clear the content of the iframe as well as it's src.

    You can use about:blank for it's src as it loads a bland page in the iframe

    so if you add

    document.querySelector(".frame_src").src = "about:blank";
    

    to the beginning of the startschedule() function, it will do the trick for you.

    your function should look like this after the change:

    function startschedule() {
        document.querySelector(".frame_src").src = "about:blank";
        clearInterval(interval), secondsleft = threshold, document.querySelector(".load_video").innerHTML = "Please Wait.. " + Math.abs(secondsleft / 1e3) + " Seconds", interval = setInterval(function() {
            startChecking()
        }, 1e3)
    }
    
    0 讨论(0)
提交回复
热议问题