hide menu when page is match.

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
twing
Advanced
Advanced
Posts: 15
Joined: Wed Apr 20, 2005 7:17 am

hide menu when page is match.

Post by twing »

Hi there,

Is there a way to not pop up the sub menu when the page is match? Currently, the sub menu is displayed when mouse hover on it.

Here is the menu arrangement:

menu1 menu2
|-menu1a |-menu2b

If menu 1 a is selected, we will go to page1A... In page1A if mouse hover on menu1, we don't display the sub menu. If mouse hover on menu2, the sub menu2 is displayed.

Hope it's clear,

Thanks.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Twing,

It could probably be done, but I think it would need to have a special javascript function to tell it when to show and not show the menu and I don't know how involved it would be. The person who might know is out of town this week. Perhaps when they return they could tell you if it is possible or not.

Ruth
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I think there is a way to do this. Can you post your menu_data.js code? I need to have your data to set it up and see if it's feasible. There's a function called mm_changeItemProperty and I think that could be used to disable the item on particular pages which would prevent the submenu from opening.

Ruth
twing
Advanced
Advanced
Posts: 15
Joined: Wed Apr 20, 2005 7:17 am

Post by twing »

I tried:
var menuNumber = getMenuByName(selectedMenu);
itemOff(menuNumber);

which didn't help. Couldn't find mm_changeItemProperty anywhere though. I'm using 5.721.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Sorry, I should have put in the link to the topic with that in it. :oops:

mm_changeItemProperty()

The only problem is, when I was trying to check this in browsers, it seems that in Netscape it still let's you click the item. The one I was testing was to disable the back that some people use, the javascript:history.back() but instead of disabling it, when you click it in netscape it goes to a page that says false. That was on a link, but I didn't get a chance to setup and try it with an item that just had showmenu.

Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

By way of example, suppose the name of the menu containing the item is "Main Menu" and the item we want to disable (so that it's normal drop-down doesn't show) is called "Products". You could disable the dropdown in a couple of ways using mm_changeItemProperty().

(1) You could set the item's type property (coderef = 34) to 'disabled'. Like so:

Code: Select all

mm_changeItemProperty('Main Menu', 'Products', 34, 'disabled', 1);
This will prevent the drop-down from appearing, but also alters the item's text so that it appears "grayed out" or disabled.

(2) You could set the item's showmenu property (coderef = 3) to null, like so:

Code: Select all

mm_changeItemProperty('Main Menu', 'Products', 3, null, 1);
This would change the item so that it doesn't have a drop-down menu anymore. This will also alter the item's appearance, removing the subimage if one has been defined (no submenu... no more subimage). If you pass a 0 instead of a 1 in the last parameter, like so:

Code: Select all

mm_changeItemProperty('Main Menu', 'Products', 3, null, 0);
then showmenu will be disabled, but the subimage will remain (because the menu was not redrawn)... note that if you run a function after that to cause the menu to redraw, then the subimage will disappear; but that shouldn't happen under normal menu use.

There are various other approaches if these two don't work for you.

Cheers,

Kevin
twing
Advanced
Advanced
Posts: 15
Joined: Wed Apr 20, 2005 7:17 am

item name

Post by twing »

Hi Kev,

Thanks for the tips.

I modify the itemName parameter in mm_changeItemProperty() to look for showmenu item property (3), because the same value is also use in keypress.js script.

After that change here is what happen:
+ user select the last menu.
+ new page displayed with no pop up on last menu.
+ But the tab doesn't work anymore.

If other menu, beside the last one, is selected, the tabbing is ok.
Post Reply