shelly323
06-09-2004, 06:34 AM
Hi. I am needing help with pop-up windows. I have a main form with a function in it that calls a pop-up tip from an array every 15 seconds. It continually
changes the tip until the user clicks the "close" button. At this point, I want the
pop-up box to close, wait 5 minutes, and reopen the pop-up. I know I need to
put this code in the onclick event of the close button, but how do I code it?
Here's my main window:
<html>
<head>
<title>We Be Toys</title>
<script language="JavaScript" type="text/javascript">
<!--
function showTips(){
tips = window.open("tips.html", "TipsWin", "width=150, height=180")
tipsTimer = setTimeout("tips.close()","14000")
}
//-->
</script>
</head>
<body bgcolor="87CEF6">
<h1 align ="center">--We Be Toys--</h1>
<script language="JavaScript" type="text/javascript">
<!--
window.setInterval("showTips()", "15000")
</script>
<h2 align="center">Welcome to our Web Site! Thanks for stopping by.</h2>
<p align="center"><img src ="yoyo.JPG" alt = "Yo-Yo Mamas" border="2"></p>
</body>
</html>
here's my pop-up window:
<html>
<head>
<title>Handy Tips</title>
<script language="JavaScript" src ="tips.js"></script>
</head>
<body bgcolor="C2E3F6">
<div align=center>
<script language="JavaScript" type="text/javascript">
document.write("<b>Tip:<br><br>"+randomTips()+"<br>")
</script>
<form>
<input type ="button" value = "Close" onClick= self.close()>
</form>
</div>
</body>
</html>
Thanks very much.
changes the tip until the user clicks the "close" button. At this point, I want the
pop-up box to close, wait 5 minutes, and reopen the pop-up. I know I need to
put this code in the onclick event of the close button, but how do I code it?
Here's my main window:
<html>
<head>
<title>We Be Toys</title>
<script language="JavaScript" type="text/javascript">
<!--
function showTips(){
tips = window.open("tips.html", "TipsWin", "width=150, height=180")
tipsTimer = setTimeout("tips.close()","14000")
}
//-->
</script>
</head>
<body bgcolor="87CEF6">
<h1 align ="center">--We Be Toys--</h1>
<script language="JavaScript" type="text/javascript">
<!--
window.setInterval("showTips()", "15000")
</script>
<h2 align="center">Welcome to our Web Site! Thanks for stopping by.</h2>
<p align="center"><img src ="yoyo.JPG" alt = "Yo-Yo Mamas" border="2"></p>
</body>
</html>
here's my pop-up window:
<html>
<head>
<title>Handy Tips</title>
<script language="JavaScript" src ="tips.js"></script>
</head>
<body bgcolor="C2E3F6">
<div align=center>
<script language="JavaScript" type="text/javascript">
document.write("<b>Tip:<br><br>"+randomTips()+"<br>")
</script>
<form>
<input type ="button" value = "Close" onClick= self.close()>
</form>
</div>
</body>
</html>
Thanks very much.