Question about highlighting mainmenu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
perldev
Mega User
Mega User
Posts: 115
Joined: Thu Aug 26, 2004 5:23 pm
Location: Chicago

Question about highlighting mainmenu

Post by perldev »

The mainmeu has 7 aIs; each aI constructed like:

Code: Select all

aI("image=nav_01.gif;imageover=nav_01-over.gif;url=/somelink.html;..")
Whenever a submenu is selected, its parent (one of mainmenus) should be highlighted (f.g: img src=nav_01-on.gif); Since the mainmenu doesn't have text property, the pagematch option seems not working.

The menu script is put right before the </body></html> tag; and window.onload might have been used already. if use window.onload to do the pagematch, first can I use more than one window.onload? second: which function can I use to get/set the image source of the mainmenu?

The site is at lind-waldock.com
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

There is a property called pageimage= which is used when you are using an image for page matching. If you have an image, as you know the 'color' pagematch won't work because of the image, but using the other you can have an image which could be used for all the page matching. This particular property can be used both in the style section which means whichever image you use would be the same for all pagematches, but it can also be an item property which means you should be able to set an image for each item. You might check the properties section of the site to see what's available. That takes you to the style properties which you put in the style section but there are also properties references for menus and for items. As to using two onload events, I don't know about such things but here's a reference I've seen before about it, I dont' know that it's the best but perhaps it will give you some information. More than one javascript on a page Hope this helps.

Ruth
perldev
Mega User
Mega User
Posts: 115
Joined: Thu Aug 26, 2004 5:23 pm
Location: Chicago

Post by perldev »

Ruth-

Thanks for your valuble suggestions. One more question: can "pageimage" match two URLs? like pageimage=/DIR_A/||/DIR_B/?
perldev
Mega User
Mega User
Posts: 115
Joined: Thu Aug 26, 2004 5:23 pm
Location: Chicago

Post by perldev »

pageimage and pagematch worked! A fix for some URL appears in different mainmenu.
A
Imagesomething1 linked to /apage.html?A
B
Imagesomething2 linked to /apage.html?B
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Well, it seems you found the answer, that's good because I had no clue. I've seen it used to match pages that aren't actually in the menu, i.e. the person used the pagematch and specified a directory rather than a page. When someone clicked on item 1 in the menu and went to the corresponding page, then item 1 was highlighted, but if they clicked a link on that page and went to those pages as long as those pages were in the same directory, then item 1 remained highlighted even though they went to pages not using the menu.

Ruth
Post Reply