Hide

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci.



Navigation Menu
Alphabetical Listing
Site Contents

Site FAQ
About JSS
JavaScript Forum
JavaScript Tutorial
Friends of JSS

Link to Us
JavaScript Help
Contribute a script
Technology Jobs

Become a Partner

Internet.commerce

Be a Commerce Partner














Internet.com

IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Developer Channel

FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Great Sites

DocJavaScript.com
dhtml.com
The Freebie Directory
TheFreeSite.com

Browse Doc JS's Tips!


Hiermenus Central


Promotions

Free Announcements


Social Bookmark

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 popup

This next one uses the javascript link inside the href tag.
Open popup

And this one uses the input button inside a form tag.

It can also be used in an image map. Here, the word 'Webhost' contains the link

Notes

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


User Comments

Add a comment, suggestion, or correction
[For questions about usage, consult the Notes tab above or visit the JavaScript forum. Do not include more than two (2) lines of code in your comments. If you have suggestions or corrections, you can submit them to us.]

    
   
       
[optional]
 
[optional]

   

Comments feed Comment Feed RSS 2.0

30. From: Terry
image map mouse over popup
01/18/2008 00:59:11

I can't seem to get your code to work.

31. From: Lee Underwood (Admin)
01/29/2008 12:50:23

It should be working just fine now.

28. From: fabiodoo
window.onscroll error ie6
12/07/2007 06:49:41

window.onscroll = self.setTimeout("self.placeIt('layer1')",500);

window.onscroll has an error in internet explorer 6
"Not implemented"

it works fine in firefox

How can I resolve this?

thanks
fabio

29. From: Lee Underwood (Admin)
01/29/2008 11:31:38

Due to the limitations of these comments, you will need to submit your question to the JavaScript Forum for further help.

26. From: jose
the function not working
11/26/2007 23:39:54

pls check the following lines of code...
i had added the JS into a test html file like this
but this is not working
pls help :(

27. From: Lee (Admin)
12/04/2007 10:57:31

Jose,
I removed your code. This area is more for comments than a discussion area. You will need to contact the author or submit your question to the JavaScript Forum for further help. Thanks!

23. From: saiful
08/28/2007 03:12:16

hello

i wanted to add several layers.. how do i do that..

thanks

24. From: Lee (Admin)
10/03/2007 14:53:44

You will need to contact the author or submit your question to the JavaScript Forum for further help.

19. From: Mark
06/14/2007 14:00:35

The source code tab appears to be missing the DIV that is called with the popup contents. (layer1)

20. From: Lee (Admin)
08/07/2007 14:43:42

It seems to be there now, Mark.

next comments...

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.