Solved

popup window

Posted on 1998-06-06
1
170 Views
Last Modified: 2010-04-09
I was visiting a site and it had a small pop-up window that said welcome and then it went away after a few seconds. I tried looking at the page source but could not find out how he did that as I would like to put that on my site to notify everone when I am on vacation. How can this be done?
With example code please, thanks.
0
Comment
Question by:dtucker
1 Comment
 
LVL 4

Accepted Solution

by:
martinag earned 50 total points
ID: 1844118
Put this at your home page:
<SCRIPT LANGUAGE="JavaScript">
<!--
newWindow = window.open('','nW','width=300,height=100,scrollbars=0');
newWindow.location.href = 'welcome.htm';
// -->
</SCRIPT>

Then you'll have to create the pop-up document, welcome.htm:
<HEAD>
<TITLE>Welcome!</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF" ONLOAD="setTimeout('self.close()', 3000);">
<H1 ALIGN="CENTER">Welcome!</H1>
</BODY>
</HTML>

At the BODY-row, we tell the browser to close the window after 3 seconds (= 3000 ms).
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now