Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

Project Seven dot com

PVII Knowledge Base

1. Select a product ...
2. Select category ...
3. Search the Knowledge Base...

Question #145

When using the MenuMagicII (MM2) in a frameset or to trigger items in an iframe, is there a way to have the menu button change to the "down state" (default) when clicked? a downstate reset?

The Answer

Prepared May. 2004 by Gerry Jacobsen, PVII

Here's a way to allow the MenuMagicII system to reset the default (down-state) button of the menu when that button is clicked, or when a link in the sub menu is clicked.

1. Add this new JavaScript function, P7_downMM2, to your script file:

function P7_downMM2(ta,bu){ //v1.0 by PVII
 if(!document.P7TabBar){return;}
 var tk=document.P7dnmm;if(tk){tk.className='';}
 ta.className=P7TabProp[4];document.P7dnmm=ta;
 P7TabProp[0]=bu;eval("P7_trigMM2('"+bu+"')");
}

2. Next, to deploy this, just place a call to the P7_downMM2 function on the menu button<a> tag or the link. For example, if you want to have the second menu button set to its down state when the button is clicked, add this to the <a> tag onClick event:

onClick="P7_downMM2(this,'p7TBim20')"

The second argument, 'p7TBim20', specifies the name of the button image that you wish to set to the down state. The entire <a> tag for the second menu button would look like this:

<a href="javascript:;" onclick="P7_downMM2(this,'p7TBim20')" onmouseover="P7_trigMM2('p7TBim20')" target="mainFrame">
<img src="../m2img/hbscb2.gif" alt="menu 2" name="p7TBim120" id="p7TBim20" width="117" height="24" border="0">
</a>

3. You can also use this directly on the individual text links in the submenus, again, just add the onClick event to the text link's <a> tag. A sample text link in the submenu would look like this:

<a href="myPage.htm" onclick="P7_downMM2(this,'p7TBim20')" target="mainFrame">Sublink 2.1</a>

This will load the "myPage.htm" file into the main frame of the frameset and also set the second menu button to the down state.

That's it!

 

Back to the questions list