Fixed item width

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
MartinSpeed
Advanced
Advanced
Posts: 18
Joined: Wed Mar 21, 2007 3:46 pm

Fixed item width

Post by MartinSpeed »

Hello.
I have a menu which is made up of background images for the menu items.

I set the itemwidth to be the width of the image.

My menus, however my menus are autogenerated depending on the names for my navigational links. Sometimes my names for links are longer than the image width.

My question is, is there a way to set the width of an item so, even if the text is too long, the menu item doesn't auto grow, it stays the width i have specified. This would be mean losing some of the text. this will be acceptable as at the moment, the image tiles which is not acceptable.

Looking into this, i thought "nowrap" may be what i was looking for. But this only works for menu text which is separate words. So "This is my text" could be made to be on multiple lines, (but this can cause an image tile downwards), but "This-Is-my-menu-text" won't wrap.

Any ideas?

Cheers
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Fixed item width

Post by Ruth »

Hi,

Given you are using background images I can only suggest you use css to set that image and its properties and then call the offclass onclass in the menuStyle, or in the items that use that image. You could also try setting the width within that class to see if that will work, though I'm not sure that will do anything to prevent the menu from expanding to accommodate the text of the item. You can control the background image with the css, no-repeat, position etc.

I don't know what your image looks like so I can't make other design suggestions which you could use to allow the image to 'expand' while still keeping the look. It can be done with many images, but I'd need to see it in order to figure whether or not that could be done using css, and different menu properties.

Ruth
MartinSpeed
Advanced
Advanced
Posts: 18
Joined: Wed Mar 21, 2007 3:46 pm

Re: Fixed item width

Post by MartinSpeed »

Thanks for your reply, I hadn't thought about the using the css functionality, i'll try that.

Thanks
Post Reply