Welcome to WebmasterWorld Guest from 54.163.40.152

Forum Moderators: incrediBILL

Message Too Old, No Replies

Popup and Close Window

     

Acternaweb

5:16 pm on Sep 10, 2001 (gmt 0)

10+ Year Member



Where can I find a code to have a window pop up after the visitor is on the site for a few seconds then close automatically.

Thanks,

tedster

5:36 pm on Sep 10, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Both the opening and closing the pop-up will require using setTimeout() in your script. I don't have any cut-and-paste code for you, but there's a decent primer for the setTimeout() method here: [hotwired.lycos.com...]

and a good pop-up window tutorial here:
[tech.irt.org...]

MikeFoster

3:57 am on Sep 11, 2001 (gmt 0)

10+ Year Member



Hi Acternaweb,

File #1

<html>
<head>
<script type='text/javascript'><!--

var
  popupDelay = 7000,
  popupUrl = "delayed_popup2.html",
  popupName = "popup1",
  popupFeatures = "width=300,height=400,toolbar=0,resizable=0";

window.onload = function() {
  window.setTimeout("openPopup()", popupDelay);
}

function openPopup() {
  window.open(popupUrl, popupName, popupFeatures);
}

//--></script>
</head>
<body>
This is delayed_popup1.html
</body>
</html>

File #2

<html>
<head>
<script type='text/javascript'><!--

var closeDelay = 7000;

window.onload = function() {
  window.setTimeout("window.close()", closeDelay);
}

//--></script>
</head>
<body>
This is delayed_popup2.html
</body>
</html>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month