running custom javascript from the menu

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
vlaad
Beginner
Beginner
Posts: 4
Joined: Sat May 10, 2003 1:43 am
Location: Santa Rosa, CA, USA
Contact:

running custom javascript from the menu

Post by vlaad »

Is this possible to get these scripts to run when the item is clicked? The situation is that there are some sections of the website I am working on that require a disclaimer to be accepted before moving on to the restricted content (no, this is not a porn site! :P). The disclaimer is in the form of a popup window, using javascript. However, the function is being run as soon as the menu finishes loading Is there a way activate the function by a click? Thanks.
User avatar
bobwill
Mega Advanced
Mega Advanced
Posts: 229
Joined: Tue Oct 01, 2002 3:03 pm
Location: Kansas
Contact:

Post by bobwill »

Here is an example of executing a javascript when clicking on a menu item, that pops up a new window in this case called "news.htm"

,"News","javascript:openNewWindow(\"news.htm\",310,350,\"scrollbars=yes\")
When clicking on the menu item "NEWS", the javascript function "openNewWindow" is executed, passing the parameters which the function requires. Below is a copy of the function.

I realize this is not exactly what you are asking for, but thought it might get you started in the right direction.

function openNewWindow(winURL,winWidth,winHeight,winConfig)
{
mmConfig=""
mmConfig="width="+winWidth+","
mmConfig+="height="+winHeight+","
mmConfig+=winConfig
var mmWin=open(winURL,"",mmConfig);
mmWin.focus();
}//-->
vlaad
Beginner
Beginner
Posts: 4
Joined: Sat May 10, 2003 1:43 am
Location: Santa Rosa, CA, USA
Contact:

thanks

Post by vlaad »

thanks for the help... funny thing is i figured it out about an hour after i posted. figures! :P
Post Reply