Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2008
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    load iframe every 3 minutes

    Hi everyone,

    I run a streaming site and would like google adsense to appear at the bottom of the page/stream every 3 minutes, stay for 15 seconds and then close automatically. Then after another 3 minutes they'd appear again, stay for 15 seconds and then close again, etc, etc.

    I'd imagine having the adsense in an iframe would be easier.

    I'd also like to give users the option to close the adsense using a close button at the top of the iframe if they don't want to wait 15 seconds.

    Is this possible?

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    That sounds fairly easy

    Code:
    function hideIframe() {
    //close iframe
    setTimeout("showIframe()",180000);
    }
    
    function showIframe() {
    //show iframe
    setTimeout("hideIframe()",15000);
    }
    
    //assign 'button' to your close button
    
    button.addEventListener("click",hideIframe,false)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •