Left padding

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
jonathan
Advanced
Advanced
Posts: 26
Joined: Wed Jul 02, 2003 1:13 pm
Location: UK

Left padding

Post by jonathan »

I have a menu that is positioned on the right hand side of the screen. As such, any sub menu goes right to left. I can force this using the 'openstyle' property of the menu which is great. I can place the subimage on the left hand side using the 'subimageposition' property of the style.

My problem is that with a sub image displayed on some items, not all the menu items are left aligned together. My site is an Intranet so I can't link to it, but the effect is like this:

Menu item 1
Menu item 2
< Menu item 3
Menu item 4

As you can see, the 3rd item looks messy as it is not aligned. What I need to do is to add a left padding to the other items. Can I do this without having to insert some hard spaces on every menu item...my menu is very large!

The effect therefore would be more like this (ignore the proportional font aligning with spaces!):

Menu item 1
Menu item 2
< Menu item 3
Menu item 4

I'd be grateful if anyone knows an easy way of doing this.

Thanks

J.
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 think I used an image and subimage to do this.

The image would be transparent or match the color.

maz
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

J,

I have had success setting the padding property of individual items using CSS-like syntax. padding=t r b l; where t = top, r = right, b = bottom, and l = left padding. So, padding=5 5 5 20; would give 5 px at top, right, and bottom, and 20px padding on the left. You can specify a unit of measue (e.g., padding=5px 5px 5px 20px;) or not (e.g., padding=5 5 5 20;), in which case px is the default.

Example menu item definition:

Code: Select all

aI("text=Item Text;url=wherever.html;padding=5 5 5 20;");
I'm not sure this is an officially support use of the padding property. There was a time that it worked, and then a few releases where it didn't, then it worked again. This approach has worked now for quite some time and I've been using it in a redesign of our website (so I hope it continues to work!)

Cheers,

Kevin
User avatar
jonathan
Advanced
Advanced
Posts: 26
Joined: Wed Jul 02, 2003 1:13 pm
Location: UK

Post by jonathan »

Thanks. I'll give it a go and report back here.
Post Reply