FAQ: Creating a popup window using JavaScript
Question:
I want to link to a pop-up window, which should be a smaller window. I think I need to use JavaScript, but I'm not sure how to do that. Can you help me to create a link to a smaller browser window like this?
Answer:
Here's what you can do to create a small pop-up window. Use the following as your URL (this example will open up a sub page for affiniscape.com):
javascript:void(window.open('http://www.affiniscape.com/displaycommon.cfm?an=1&subarticlenbr=1','WindowName','width=500,height=400,left=50,top=75'))
That link will open an Affiniscape sub page in a window called WindowName. (The name of the window is unimportant, except that if you use another javascript command with the same window name, it will replace the contents of the existing popup.)
The width and height of the popup in this example are 500 pixels by 400 pixels. The window will open 50 pixels from the left of the screen and 75 pixels from the top of the screen.
Just replace the link and the numbers for width, height, left, and top in order to customize the link the way you want it. Leave all the parentheses, quotes, etc. just as they are.
NOTE: For sub pages you wish to open as pop-ups, it is normal to turn off your left and top graphics. On the admin page for your sub page, just choose "No" for the two questions about including the left navigation and area header.