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:04
Left padding
Poster: jonathan
Dated: Friday November 5 2004 - 12:46:12 GMT
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.
Poster: Maz
Dated: Friday November 5 2004 - 15:20:17 GMT
I think I used an image and subimage to do this.
The image would be transparent or match the color.
maz
Poster: kevin3442
Dated: Friday November 5 2004 - 21:57:22 GMT
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:
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