GotFusion.com Where your journey begins
Showcase your website at Fusion GalleriesNetObjects Fusion 7 Websites Portal

 


 

Opening a Pop Up Window using JavaScript

Select any of the links below to see how the PopUp window opens (and closes)

All JavaScript PopUp windows are opened in exactly the same manner from within Fusion:

onClick="window.open('http://www.gotfusion.com','gotFusion','toolbar=1,location=1,
directories=0,status=0,menubar=1,scrollbars=1,resizable=1,copyhistory=0,width=800,
height=600,left=0,top=0')"

Note: This and all inline JavaScript examples need to be one continuous line of code not broken with returns. Take the above code into notepad and remove all wrap before pasting to your page.

View a list of all of the window attributes and what they represent.

The different parts of a JavaScript window open command

Note: You can use relative notation for the link if the page is within your web site (relative notation would be ../popups/fileName.html where ../ would tell the browser to go down one folder levels to find the popups folder and use fileName.html as the document to open).  To do this change link name (the URL) to correspond to the actual location of the file on your web site (../popups/cuteKitty.html) so that it corresponds to the location and name of your popup html page. Change the window name 'gotFusion' to a unique name for each window you open. If you use the same window name in all your scripts the new content will be loaded in the same popup window. If you use the same window for all popups make certain that the content will fit as the size of the window that you initially specify will not change (if you reuse popup windows by keeping the same name and the page contents are different sizes you will truncate your information..... using unique names avoids this problem, the initial width=??,height=?? statement cannot be adjusted without further scripting). Change any of the 0 (zero) to 1 to turn on any window attribute such as toolbar, location bar, menu bar, as required. Change the width=800, height=600, and position of the pop up window left=0,top=0, to the size and position that you want your window to be.  You should create the pages that you want to popup before you write the link so that you know the proper relative location and the correct size of the page to enter into your script. Important: If you move any popup target pages you must edit the script manually to reflect the new location of the page.  These directly entered relative links are NOT internally maintained by Fusion.

Return to the TOP of this page

View the NEXT page in this tutorial


 

All content copyright © 2001 - 2005 gotFusion LLC. The name gotFusion and the gotFusion ® logo are registered trademarks of gotFusion LLC
Copyright, legal notice & privacy statement