Selteco Software

Popup a window in Menu Maker

How to define onclick action to popup a window by clicking a menu item.

NOTE: Minimum Menu Maker version 4.1

Open your menu and choose "Menu" > "JavaScript". Define popup function here:

function popupwindow(url,targetname,parameters)
{
	window.open(url,targetname,parameters);
}

Click OK

Select the item in the left pane and choose "Edit" > "JavaScript OnClick..."

Enter popup code:

javascript:popupwindow('http://www.selteco.com/logo40.gif'
,'FrameName','height=475,width=600,top=0,left=0,resizable=no,scrollbars=yes'); return false;

return false code is necessary to block the URL from being invoked.

Click on "Item 1" to test the popup.

 

The parameters URL, name, parameters have the following meaning:

URL String specifying the location of the Web page to be displayed in the new window.
targetname String specifying the name of the new window. This name can be used in the same constructions as the frame name provided in the frame tag within a frameset <FRAME NAME=name ...>. For example, you can use hyperlinks of the form <a target=name href="page.htm">, and the hyperlink destination page will be displayed in your new window.

If a window with this name already exists, then window.open() will display the new content in that existing window, rather than creating a new one.

parameters An optional string parameter specifying the features of the new window. The parameters string may contain one or more feature=value pairs separated by commas.

The following features are available in most browsers:

toolbar=yes|no Specifies whether to display the toolbar in the new window.
location=yes|no Specifies whether to display the address line in the new window.
directories=yes|no Specifies whether to display the Netscape directory buttons.
status=yes|no Specifies whether to display the browser status bar.
menubar=yes|no Specifies whether to display the browser menu bar.
scrollbars=yes|no Specifies whether the new window should have scrollbars.
resizable=yes|no Specifies whether the new window is resizable.
width=pixels Specifies the width of the new window.
height=pixels Specifies the height of the new window.
top=pixels Specifies the Y coordinate of the top left corner of the new window. (Not supported in version 3 browsers.)
left=pixels Specifies the X coordinate of the top left corner of the new window. (Not supported in version 3 browsers.)


Comments?

If you would like to briefly comment on this article, you can enter your remarks in the space below (up to 255 characters):