Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
mjau-mjau
X3 Wizard
Topic Author
Posts: 13998
Joined: 30 Sep 2006, 03:37

Open a popup window

19 Mar 2009, 04:22

You may want to open external links in popup windows - This can be done with links in the main menu, and also any links you have in descriptions. The method involves adding some javascript to your link -

Popup window for main menu
To create a popup window for external links in the main menu, you need to first add your link as you normally would by creating a folder item, and setting it to "use as [link]". In the LINK field, you then need to add your link like this:
Code
javascript:newWindow=window.open('page.html','window_name', 'width=500,height=300,scrollbars,resizable');newWindow.focus();void(0);
  • #Change page.html with the link to any page you want to open
    #Change 500 and 300 with the width and height you want for your popup window
    #If you don't want scrollbars, just remove that item in the array
    #If you don't want the window to be resizable, just remove that item
Popup window for normal links
You may have links in your descriptions or titles that you want to open popup windows, instead of normal windows. To do so, you will be adding a link to the textfield like normal HTML -
Code
<a href="page.html">Click here</a>
Then you need to switch the value of HREF to include the popup code:
Code
<a href="javascript:newWindow=window.open('https://www.photo.gallery','window_name', 'width=500,height=300,scrollbars,resizable');newWindow.focus();void(0);">Click here</a>