Using an image for Menu Item Separator

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
markfennell
Beginner
Beginner
Posts: 2
Joined: Fri Jul 11, 2003 11:19 am

Using an image for Menu Item Separator

Post by markfennell »

I would like to use an image as the menu Item separator
however my javascript isnt quite good enough to decipher the code :D

Any help as to where to modify the code to to this would be most appreciated!
regards Mark Fennell
------------------------
http://www.markfennell.com
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

As far as I know, there is no actual feature in the menu to allow you to do this. But there are two work arounds that I can think of.
First you could use the image option that is available in the menu. I.E...

Code: Select all

aI("text=Search;url=http://www.google.com/;target=_blank;image=images/xpsearch.gif;");
This would place the image to the left of your text in the menu item. So you could put an image in the 2nd through n menus, to get a separating effect.
The other option is to put the image code right into the text label of your menu item. I.E....

Code: Select all

aI("text=Search<img src='images/xpsearch.gif' border=0>;url=http://www.google.com/;target=_blank;");
And like I said above, arrange them so you get the right effect. Hope this helps!
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 »

The third option would be to simply have no text and make a seperate menu item for each seperator. This would allow you to equally apply styles (aka spacing and height) to the seperators.

By was of example...

aI("text=<img src='images/xpsearch.gif' border=0>;");

or with spaces....

aI("text= | ;");

etc...
markfennell
Beginner
Beginner
Posts: 2
Joined: Fri Jul 11, 2003 11:19 am

Post by markfennell »

Is there a way to simply hack the code so i can make the separator between menu items have a background image?
regards Mark Fennell
------------------------
http://www.markfennell.com
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Don't quote me on this, as I have not looked at the code to see if this is exactly the case, but I am pretty sure. I don't think there is a way to do that because the 'separator' that you can 'turn on' is really just drawing the border on the edge of the layer/cell that the menu consists of. There is no 'object' persay that is being drawn or invoked. Now you could hack the code to insert an entirely new layer/cell in between menu items as the separator but that would entail messing with the sizing, dimensioning, and bookkeeping of menus amongst other things. It'd be a pretty big hack. I personally liked zotsf's idea where you just create a menu inbetween all your 'real' menus and assign it a style that puts a background in there.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply