Navigation Menu

Site Contents
What's New?


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

Partner With Us
Shop Online
Swim at Home,Free DVD
Promotional Pens
Boat Donations
Imprinted Gifts
Online Shopping
Web Hosting Directory
Online Education
Logo Design
Promotional Items
Free Business Cards
Compare Prices
KVM over IP
Corporate Awards

Internet.com

IT
Developer
Internet News
Small Business
Personal Technology
International

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


General

This script opens a floating layer popup. This technique allows the user to work in the main window while still being able to view the popup. The popup window will hover at the same spot where it opens, even if the user scrolls down the page.


Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: floatingLayer.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]

    
   
       
[optional field]
 
[optional field]

   

Comments feed Comment Feed RSS 2.0

17. From: Kat
A Suggestion
11/05/2007 05:21:48

I have a suggestion: How about if it opened by itself automatically, and can detect if you've seen it before, so it doesn't open again unless you come back to it another day?

19. From: Sandeep
Re: A Suggestion
01/04/2008 07:21:17

Check out script #17 on this page:
http://www.sivamdesign.com/scripts/popups.html
The cookie code can be incorporated into this script to get the functionality you need.

18. From: Lee (Admin)
11/13/2007 11:29:53

Sounds good, Kat. That could be done with a cookie. Why not put something together and I'll post it with credit to you?

16. From: murali
nice one
07/04/2007 04:27:49

i tried ur source.its really nice.
when i scroll the popup dosent scrolls automatically.

any solution is there?

15. From: Lee
01/03/2007 11:52:20

Ross,
Thanks. I made the change. We use a different loading procedure so I didn't catch that.

14. From: Carey Lott
12/19/2006 13:24:25

To Naveen:
Is the new html located on your pc or have you uploaded it to your website?
I get the same warning whenever I try to open a html page that uses scripts that is located on my pc. However, I don't get the warning when I view the page once it is on the web server.

To Richard:
I'm viewing the example with IE7 and I'm not getting an error.

Does anybody know if this could be easily modified to work with onMouseover and onMouseout?


13. From: Ross
12/03/2006 18:29:23

This message is for Mike Swift.

there is a way to do that when you have done the image map just put within the href tags: "javascript: FUNCTION()" replacing FUNCTION() with your function

ex. showIt()

hope this is helpful.
happy coding!!!


12. From: Ross
12/03/2006 18:25:19

The script works really well but in the part at the end where it says:

onResize="window.location.href = window.location.href";
window.onload="placeIt";

***there should be "()" after "placeIt" so that it calls the function properly. Otherwise the "placeIt" function doesn't work so the popup doesn't move with the page.***


11. From: Richard G
12/03/2006 10:52:53

I love it and want to use it but it generates a JS error in IE 7 because of the use of "document.all" in the Javascript which I have read is depreciated.

Unfortunately, I don't understand how to fix this. Would it be possible to repost with a fix to this?

Many thanks!


10. From: Jeroen Haan
12/01/2006 16:31:12

Dear Bill,

Just wrap the image with the div tag of course with all attributes but leave the table and maybe some CSS (style) out.
I didn't test it but it should work dough.

Dear Mike,
Please see this example:
haan.net/test/popup-div.php
It works with anchor tags and with the image map.

cheers,
Jeroen Haan


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.