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:52

On State for image in nav


Poster: jlwood
Dated: Wednesday March 2 2005 - 16:10:09 GMT

I would like to set the on state of images in my left nav so that if you are on the page the image is highlighted. I have done this in the past with milonic navs that are just text by using the onbgcolor attribute in the style.

Can't seem to find where to set the on image.

Here is an example of one of my sub menus:

Code:
with(milonic=new menuname("ourHistory")){
style=subMenuStyle;
aI("image=../images/leftNav/historyStJames.gif;overimage=
../images/leftNav/historyStJamesOn.gif;status=History of St. James;
url=../ourHistory/historyStJames.aspx;");
aI("image=../images/leftNav/historyCharlesTown.gif;overimage=
../images/leftNav/historyCharlesTownOn.gif;status=History of Charles Town;
url=../ourHistory/historyCharlesTown.aspx;");
}


Poster: Ruth
Dated: Wednesday March 2 2005 - 20:59:45 GMT

If you mean the highlight path, there is a property in the menu style to do that. pagebgcolor and pagecolor refer to the bgcolor that will be highlighted on the menu items when you are on the page that corresponds. Because you have images and overimages you will have to use pageimage. This means creating and image the same as what you have but a different color that will show when the page is in the highlight state. Maybe a you are here image. It has to match the same size as what you have.

If you'd put up a test page with the menu we could check more easily.

Ruth


Poster: jlwood
Dated: Wednesday March 2 2005 - 21:13:55 GMT

Ruth,

I tried the following with the pageimage attribute, but I saw no result.

Maybe I am not following you. I am using all images in my nav so the background colors of tables cells etc. will not help me much.

Code:
with(milonic=new menuname("ourHistory")){
style=subMenuStyle;
aI("image=../images/leftNav/historyStJames.gif;overimage=
../images/leftNav/historyStJamesOn.gif;
pageimage=../images/leftNav/historyStJamesOn.gif;status=History of St. James;
url=../ourHistory/historyStJames.aspx;");
aI("image=../images/leftNav/historyCharlesTown.gif;
overimage=../images/leftNav/historyCharlesTownOn.gif;
pageimage=../images/leftNav/historyCharlesTownOn.gif;status=History of Charles Town;
url=../ourHistory/historyCharlesTown.aspx;");
}


Poster: Ruth
Dated: Wednesday March 2 2005 - 21:21:54 GMT

without seeing the menu, so I can see the images I just have to try words to describe it. but, let's say you have historyStJames.gif and historyStJamesOn.gif, and they are 25px high and 50px wide. If all your images are that size, then you could make one image that size which say You Are Here, or whatever you want to put on it. Then you would code in the menuStyle where you have the onbgcolor, offbgcolor etc, pageimage="whateveryounamedit.gif" then when you were on that url historyStJames.aspx you should see the pageimage you created. If the images are different sizes, then you would have to make a different image for each, and you'd put in the aI string another parameter pageimage=whateverimage.gif; along with the image= overimage= etc.


Poster: jlwood
Dated: Wednesday March 2 2005 - 22:02:57 GMT

I have set it up here:

http://www.canalstreetmalthouse.com/aTesttesttest/stPetersChurch/nationalPark.aspx

Not really sure what is wrong.

Thanks in advance,
Joe


Poster: Ruth
Dated: Wednesday March 2 2005 - 23:03:00 GMT

I don't know why it's not working on the site, unless it has something to do with asp. I downloaded the main page, and the two historyof pages, put them and the images in the same directory and the pageimage works fine. Of course, I had to make them html pages. And, I know it's not the path, since you are using the on image for the pageimage and the onimage is working. I really get confused on paths, but I have to think it's either the path for the url or the image, or it has to do with the asp. I'll post for some pro help and let you know.

Ruth


Poster: jlwood
Dated: Thursday March 3 2005 - 17:16:41 GMT

Hmm . . .

The only weird thing going on is that I am including everything except the basic content area. I am including them using .net user controls. In this case this is not much different than using server side includes or asp includes or any kind of include. There is no 'logic' at this point. Just HTML in the includes.

Thing is . . . in the end it all ends up as html so I don't think it should be any different.

I wonder how the left_nav 'knows' which page it is on? Is it looking at the current url and comparing it to the url values in menu_data? Maybe it just doesn't like the aspx extension?

Thanks for the help Ruth!


Poster: Ruth
Dated: Friday March 4 2005 - 12:21:46 GMT

I suggest you post another topic using ASP, maybe pagematch/path highlight not working with ASP, or something like that. Maybe someone with more knowledge of ASP and an easier grasp of paths can help. I have no clue but for some reason paths have always been a problem for me, I finally gave up and now I just put the full path in all my image links! :?

And, one other thing to try, for testing and comparison. Put pageimage= like you have it now, and then put in pagematch= and type in the url you have in the url= section, see if that matches it.

Ruth