homepage Welcome to WebmasterWorld Guest from 54.205.144.54
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Popup and Close Window
Acternaweb




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

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




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

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




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

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>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved