General
This script will open a floating layer popup. The layer stays on top, allowing the user to work in the main window while still being able to view the popup. The popup window stays in the same place, even when the user scrolls down the page. It also works with image maps.
This link uses the onclick event handler.
Open popupThis next one uses the javascript link inside the href tag.
Open popup
It can also be used in an image map. Here, the word 'Webhost' contains the link
Notes
- Created by: Jeroen Haan
- Web Site: http://www.haan.net/
- Posted: December 8, 2006
In the source code you see return false and target='_self"'. These are measures are to prevent unwanted behavior when the base target is set to _blank or when you want to provide the user with an alternative link in case JavaScript isn't turned on in the user's browser.
The first layer should be place right after the <body> tag.
Source Code
Paste this source code into the designated areas.
External file
Paste this code into an external JavaScript file named: popupDiv.js
CSS
Paste this code into your external CSS file or in the <style> section within the HEAD section of your HTML document.
Head
Paste this code into the HEAD section of your HTML document.
Body
Paste this code into the BODY section of your HTML document
Do you write JavaScripts?
If you do, why not submit them to us?
We'll give you credit and a link back to your Web site.
