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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    I want to creating a popup window for my website project can any body help?

    1. the 1st popup should open automatically and open a URL 1
    2. then after 30sec the popup should close
    3. then 2nd pop up window should appear and open URL2
    4. then after 30sec the popup should close and so on

    can any body help me with this please. I really need it.

    Or it can be like this also,

    The 1st popup should open automatically and open a URL1 then, after 30sec it should open URL2 and after 30 sec open URL3 and so on in the same popup. Please help.

  • #2
    New Coder
    Join Date
    Jan 2009
    Posts
    42
    Thanks
    2
    Thanked 6 Times in 6 Posts
    Code:
    <html>
    <head>
    <script>
    var win,intvl;
    
    // variable to keep track of current array index
    var i = 0;
    
    // create array of urls to display in the popup
    var urls = ['http://www.site.com/page1.htm',
                    'http://www.site.com/page2.htm',
                    'http://www.site.com/page3.htm'];
    
    window.onload = function() {
       showPopup();
       intvl = setInterval(showPopup,30000);
    }
    
    function showPopup() {
       if (!win || win.closed) win = window.open('','_blank','width=500,height=300');
       win.location = urls[i];
       (i == urls.length-1) ? i = 0 : ++i;
    }
    </script>
    </head>
    <body>
    test page
    </body>
    </html>

  • Users who have thanked jcrypt for this post:

    uydarp (01-09-2009)

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Quote Originally Posted by uydarp View Post
    1. the 1st popup should open automatically and open a URL 1
    2. then after 30sec the popup should close
    3. then 2nd pop up window should appear and open URL2
    4. then after 30sec the popup should close and so on

    can any body help me with this please. I really need it.

    Or it can be like this also,

    The 1st popup should open automatically and open a URL1 then, after 30sec it should open URL2 and after 30 sec open URL3 and so on in the same popup. Please help.
    That is why modern browsers block unrequested pop-ups.

  • Users who have thanked Philip M for this post:

    itsallkizza (01-08-2009)


  •  

    Posting Permissions

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