|
|||||
(beginner) |
The easiest pop-up window pops up when the page loads, and does not require an on-click event to trigger it. It comes in handy when you want to make a special announcement that you don't want your visitors to miss. (example) However, this is also the sort of window that, most annoyingly, opens on numerous commercial websites. People hate that sort of window, especially since they have no control over it's appearance: all they do is open a webpage, and there's the window! Therefore, use it judiciously. The information contained in such a window should be absolutely relevant to the visitor of the page: on a job site, it might list new job openings; on a theatre site, the present schedule of events; on a store site, the items on sale at the moment. It's also a good idea to give the visitor a chance to close the window right on screen, with a simple clickable link in the window itself. To achieve that, just place the following line of code inside and at the bottom of the window's contents:
This will create a link that closes the popup. And here's the code for the window itself; just insert it between the <head> tags of your document:
For "yourlink.html", write the file name of the window you
want to open. That's all there is to it: No code beyond that is required, since the window opens when the page loads, with no event handler necessary. |
||||
|
|
|||||