Opening Windows and Frames with the Menu |
Opening Windows and Frames with the Menu | |
aI("text=Open Google in New Window;url=http://www.google.com;target=_blank"); The above menu item sample will create a new instance of your browser and automatically navigate to the web site you have declared in your menu item text string. You can also replace the target with _new or the name of a frame. You can even take this step further and open a customized browser instance with control over the following browser properties
This feature is included within the menu and is controlled by the targetfeatures property in your menu item. If you wanted to open a new browser window for a specified link but limit the size to 300 pixels wide by 300 pixels high, you would declare a menuitem like this: aI("text=Open Google;url=http://www.google.com;target=windowname;
targetfeatures=width=300,height=300"); aI("text=Open Google;url=http://www.google.com;target=windowname; targetfeatures=width=300,height=300,status,scrollbars,resizable"); The above principle applies to all other window opening properties (from the list above) when opening windows using this technique. If you omit the targetfeatures property the standard browser will load as though you had selected it by clicking on an icon on your desktop. In order to open the menu in an IFRAME you will need a custom JavaScript function. This function is very easy to integrate but it must be used in conjunction with the menu because it uses built in menu functions to get a reference to the IFRAME . Please note that at this stage this will not work for Netscape 4.x - Netscape 4.x does not support IFRAMES but you can have similar IFRAME functionality by using Layers. We will create a sample for Netscape 4.x at a later date. Please let us know if you need a sample for Netscape 4.x now and we can send you at least a workaround. The function is called openIframe and it's parameters are IFrameID and URL function
openIFrame(IFrameID, URL){ You must have an IFrame embeded in your HTML for the above function to work. You must also give the IFrame an id that will be it's reference in order to change the URL. The menuitem for changing the URL of your IFrame will need to look something like this: aI("text=Open Google in IFrame;url=javascript:openIFrame('tempiframe','http://www.google.com'") |
- Dynamic Downloads are possible for the Opening Windows and Frames _H_T_I_W_ the Menu demo
- The code for this menu sample will be generated on the fly and compiled into a .ZIP file format for downloading onto your own machine.
Click here to download this sample
Note that you need to logged in to download the menus and the download delivered will depend on your current license status.