Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:07

change menu "off"image in "ON" image by javascript


Poster: webmaster_magnolia
Dated: Wednesday December 9 2009 - 1:07:19 GMT

Hi Experts,

i am opening a sublevel webpage directly by a html-deeplink not by clicking - so the created milonic menu build from images doesnt show for the correct level and pageimage the "ON"-image - the complete menu is shown with off-images.

How can I change the off-image to my correct "on"-image after loading the milonic menu to show the user his actual visited page position in the menutree?

In Firebug i can localize the image:
Code:
<td id="_imgO6">
<img id="img6" border="0" src="menuimages/mag_menu_l2_207_off.gif" style="display: block;" onload="_p2(0,this)"/>
</td>


and it should be "mag_menu_l2_207_on.gif" - to show the user that he is in the area of submenu "sub02_7"

Any help for me out there
Thanks

Rainer

Re: change menu "off"image in "ON" image by javascript


Poster: Ruth
Dated: Wednesday December 9 2009 - 1:11:37 GMT

Hi,

Do you have a test page please, or link to the site so I can see what is happening? I need to have the page to be able to test it and try and find an answer.

Ruth

Re: change menu "off"image in "ON" image by javascript


Poster: webmaster_magnolia
Dated: Wednesday December 9 2009 - 1:30:21 GMT

Hi,
http://www.magnolia.de/hp/de/02_7_2.htm

this page should hilight the menu 03.7 the last item in the horizontal menu
and the second item in the vertical level 3 - offer.de 03.7.02
(don't worry about the filename starting with 02_...)

thanks for help

Rainer

Re: change menu "off"image in "ON" image by javascript


Poster: Ruth
Dated: Wednesday December 9 2009 - 2:38:24 GMT

Hi,

Just so I make sure I am right here. You are saying that the item which has the image which says 03.7 Film and Funk, you are saying should be the on image, which is a different color. However, that pageimage is a 'pagematch' image, that is a you are here type image. So, the url has to match the url of that item. So, the url for that item is
Code:
02_7_1.htm#start
however, the page you sent me to is
Code:
02_7_2.htm
Since you are not on that 02_7_1 page the pageimage will not show. At least as far as I know that is how the page properties work.

Let's say I click on the far left vertical menu, on the portfolio one and now I'm on the portfolio page. If you click on the Film and Funk item in the horizontal menu, you go to 02_7_1 and now the Film and Funk is highlighted and so is the first item in that submenu, that's because they both have the same url. Now if you click item two, the Film and Funk stays highlighted and the 2nd item gets highlighted also, that's because it is showing you the 'path' in the men that you took to get where you are.

If you are getting to the page by a link on another page, instead of by the menu, there will be no 'highlighting'. Only once you use the menu will you get highlighting.

I hope that made sense! :)

Ruth

Re: change menu "off"image in "ON" image by javascript


Poster: webmaster_magnolia
Dated: Wednesday December 9 2009 - 8:52:03 GMT

Hi, thanks a lot for your answer,
and my question is now, is it possible to manipulate the established milonic menu after creating?

There must be an array with the img-sources and i would like to overwirte the entry for 2 image-src values:
1.) in the submenu02 i want to change the standard value of
image=menuimages/mag_menu_l2_207_off.gif;
to image=menuimages/mag_menu_l2_207_on.gif;

and 2.)
in the from 1 called submenu
image=menuimages/mag_menu_l2_02_7_2_off.gif;
to the new value
image=menuimages/mag_menu_l2_02_7_2_on.gif;

In the Browsers DOM is it possible for example with
Code:
<script type="text/javascript">
function  newslinkon() {
document.getElementById('img6').src = "menuimages/mag_menu_l2_207_on.gif";
document.getElementById('img40').src = "menuimages/mag_menu_l2_02_7_2_on.gif";
}
onload=newslinkon();
</script>

with that code at the end of the page, but after mouseovers the milonic code resets the src with the original values from the milonic array.

thanks for helping
Rainer

Re: change menu "off"image in "ON" image by javascript


Poster: Ruth
Dated: Wednesday December 9 2009 - 19:26:55 GMT

Hi,

I have posted this to Milonic, since I do not have the information and I don't know much about functions, but I wanted to let you know someone is, hopefully, looking at this :)

There is a way to set up the menu so that the page properties will show even when the page is reached by a link outside the menu, but with your setup it isn't possible, and I don't know that you'd want to set up your site to do this, anyway the way to do this is to have a folder for each related pages, then in the item for the various pages you put in pagematch= and the url path would be not to the page, but only to the folder in which it is. With this kind of setup, then any page inside a particular folder will show the page properties whether you reach it by an html link on a page or through the menu. So, let's say you put the Film and Funk page in a folder called film, and you also put in that folder that second item, and in each item put
Code:
pagematch=http:whatever.com/de/film/
Because you have the pagematch set up to the folder any page in that folder which has that pagematch in it will show the page properties. Now, personally I think that is a lot of work.... Perhaps Milonic will have another option to use that function you have :)

Ruth