JavascriptToolbox.com Now Available!

Almost all of my javascript code has been moved over to its new home at The Javascript Toolbox. Please go there to find the latest scripts, information, etc. These pages will remain here for a while for historical purposes in case anyone needs a production copy of old code.
PopupWindow
[Javascript Toolbox]  [Example]  [Source]
Description:
This JavaScript Object fills a need that comes up often: A user does some action and you want a small window to popup, either with text to display, or an option to pick, or any other type of interface.

This object lets you quickly and easily get this done without having to mess around with all the dirty work. A few lines of code is all you need!

See the Source for more details on usage of the code.

NOTE: This file also needs the AnchorPosition.js file in order to work.

Note: Why are form elements or <SELECT> boxes showing over top of the DIV-style calendar popup? It's not a bug in the javascript - it's a bug/feature of browsers. See this explanation by WebReference.

Example:
(View the source of this page to see how easily all this was done!!)

This popup will automatically hide itself if you click anywhere else on the page.

Test Anchor 1
This link will popup a browser popup window 100 pixels to the right and 50 pixels below the clicked link.
It will close itself whenever you click anywhere else on this page.
If the window would be positioned off the screen, it will automatically be adjusted so as to not be off-screen.
Test Anchor 2



This popup will not hide itself automatically, so it will stay showing permanently unless the developer provides a method to close it, as I've done:
                Test Anchor 3



This window will open up a small window to cnn.com
It will close itself whenever you click anywhere else on this page.
If the window would be positioned off the screen, it will automatically be adjusted so as to not be off-screen.
Test Anchor 4



This is an example of how to have a popup contain choices for the user to pick from, to populate a form field.
Select