Page Highlighting Image

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
moholland
Advanced
Advanced
Posts: 10
Joined: Wed Jun 25, 2003 2:48 pm

Page Highlighting Image

Post by moholland »

Is it possible to have the xp style image that changes on mouseover to also indicate the currently selected page? I only see 'pagecolor' and 'pagebgcolor' which changes the text color and background color. I guess I'm looking for 'pageoverimage' which doesn't appear to work. Thanks for your help.
zotsf
Advanced
Advanced
Posts: 17
Joined: Wed Jun 11, 2003 11:43 pm

pageoverimage

Post by zotsf »

I'd really love to see that as well. Is there an existing way? or is that still being developed?
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Oh yeah, good point. hadn't thought of that.

Leave it with me and I'll see that I can do ;)

Cheers
Andy
zotsf
Advanced
Advanced
Posts: 17
Joined: Wed Jun 11, 2003 11:43 pm

pageover image

Post by zotsf »

yah! [patiently waiting like a dog] [wagging tail] :)
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

I've just posted version b4.1.13 to http://milonic.com/4beta/menu.htm

Included is a new parameter called pageimage that can be declared in the style or in a menuitem.

Code: Select all

pageimage=/images/pageimg.gif;
Enjoy!

Cheers
Andy
zotsf
Advanced
Advanced
Posts: 17
Joined: Wed Jun 11, 2003 11:43 pm

Post by zotsf »

Very cool. I've got it implemented, but there seems to be a bug...or I'm missing something.

When you are on one of the top level pages, pageimage= doesn't work. If you are on a page that is under that top level page, then it does.

Check it out...

http://dev.benzot.net/index.jsp

:)
moholland
Advanced
Advanced
Posts: 10
Joined: Wed Jun 25, 2003 2:48 pm

Post by moholland »

Andy, thank you for the update... amazing service.

zotsf, i could be totally wrong but it looks like the menu might not work in your case because the files are in different folders but they are all still using the same name... 'index.jsp' Maybe if you added a dummy query string to the link then that would help because the menu is working perfectly for me. Every page is the same name but with a different value in the query string. So, 'index.jsp?z=products' for example. Hope that helps but I could be totally wrong.
zotsf
Advanced
Advanced
Posts: 17
Joined: Wed Jun 11, 2003 11:43 pm

Post by zotsf »

Yeah, Andy, thanks for the speedy turn around on this one. Extremely cool.

And thanks, moholland, for the tip, but unfortunately it didn't solve the problem.

I tried your suggestion of adding a parameter to one, and then all, of the links. I even tried changing company/index.jsp to company/company.jsp to no avail. :|

Any one else have a suggestion?
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

I'm slowly making changes, don't know where this error is:
line 9 char 17797 _mi [...].18' is not an object

edit:
---------
;;;;;;; //some of these were missing
---------

Will this be correct as stated above:
aI("text=
to
aI("pageimage=/images/

edit:
---------
image=
---------

Thank you!
maz
zotsf
Advanced
Advanced
Posts: 17
Joined: Wed Jun 11, 2003 11:43 pm

Post by zotsf »

[quote="maz"]I'm slowly making changes, don't know where this error is:
line 9 char 17797 _mi [...].18' is not an object

edit:
---------
;;;;;;; //some of these were missing
---------

[/quote]

Thanks. I'm not sure that makes much of a difference though :(

[quote="maz"]
Will this be correct as stated above:
aI("text=
to
aI("pageimage=/images/

edit:
---------
image=
---------
[/quote]

I don't understand. Are you saying to replace 'pageimage' with 'image'?

Thanks.
zotsf
Advanced
Advanced
Posts: 17
Joined: Wed Jun 11, 2003 11:43 pm

Post by zotsf »

What I'd ideally like, is to have pageimage work anywhere within a given directory (like .../education/... ) regardless of whether or not the particular page you are on is part of the navigation menu.

check out http://dev.benzot.net/ again. The highlighting I'd like is seen if you click on one of the sub menu links, say 'education/one.jsp'.

In this example, if you go to education/one.jsp, education/two.jsp, education/three.jsp, or education/four.jsp you get the highlight effect I want. If you go to education/five.jsp, which is not on the menu but does exist, the highlight would work. I'd also like it to work if you are at the top level, education/.

Andy, maz, anyone?

Thanks guys. :)
zotsf
Advanced
Advanced
Posts: 17
Joined: Wed Jun 11, 2003 11:43 pm

Post by zotsf »

yaah, RC2 addresses part of this issue. Now if you are in the top level directory or on a page that is linked to from a menu, the pageimage works correctly.

Any chance we can get the pageimage to work on a directory level across the board? Meaning, can you set it so that pageimage works when on pages that are not in the menu, but are in the top level directory?

Again, by example....

the menu would currently contain the following links:
education/
education/one.jsp
education/two.jsp
education/three.jsp

the menu would NOT contain the following, but the files would be there and linked to elsewhere on the page:

education/four.jsp
education/five.jsp
etc...

Look at http://dev.benzot.net/v52/ for an example
Thanks :)
zotsf
Advanced
Advanced
Posts: 17
Joined: Wed Jun 11, 2003 11:43 pm

work around

Post by zotsf »

I've got a work around for pageimage.

As explained (maybe not so well) above I'd like the 'pageimage' function to work for any page within a given directory rather than just the pages that are linked to from the menu.

my work around discards use of the pageimage function and simply utilizes more than one menu with some logic.

var loc = location.href;
if(loc.indexOf('education')) {
menuone
} else if (loc.indexOf('products')) {
menutwo
}
etc...

This way if we are in the 'education/' directory, menuone has the education menu item as the highlight. If we are in the 'products/' directory, menutwo has the products menu item as the highlight.

see http://dev.benzot.net/v4/ for an example.

Hopefully this is a short term solution but it works :)
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

I agree that this would be a neat feature, but I think it kinda defeats the purpose of having the menu. If you get to a page using the menu, then obviously the whole point of the menu was to get you there and the point of the highlighting is to show there that page lies in the menu hierarchy. The menus don't necessarily (and in most cases do not) have to follow the directory structure of the server.
I think thats really cool that you got it working for your purpose. But I think to have that implemented would be costly (but if anyone can do it, andy can) and also tough to implement correctly all the time. If people had two pages under the same directory that were located in different menus because they had nothing to do with each other, then it would cause incorrect highlighting.
I look back on this and it looks like I am trying to shoot you down, but I don't want it to come off that way. I apologize if it does. I am just try to saying having it in there would be fixing a very specific and rare problem, and might cause more problems then it was originally supposed to fix. Just my two cents. :roll:
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
zotsf
Advanced
Advanced
Posts: 17
Joined: Wed Jun 11, 2003 11:43 pm

Post by zotsf »

No worries, I don't feel shot down.

I see your point that as a general function my request could cause as many problems as fix them regarding directory structure.

Maybe there could be a seperate function that allows the developer to indicate "section" or "category" that would enable them to set a trigger which calls pageimage or something.

For now I've got my specific work around.

Thanks :)
Post Reply