...

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



uydarp
01-08-2009, 03:56 AM
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.

jcrypt
01-08-2009, 06:31 AM
<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>

Philip M
01-08-2009, 08:20 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum