Couple problems/question with the Background Menu Item Image

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
kelemvor
Super Advanced
Super Advanced
Posts: 39
Joined: Mon Jun 17, 2002 2:05 am

Couple problems/question with the Background Menu Item Image

Post by kelemvor »

Howdy, I'm using this menu: http://milonic.com/menusample.php?sampleid=20

and I have a couple questions.


--I'm playing with the sample and for some reason the top menu item keeps displaying as the word MILONIC. It loads up with the proper name of whatever I call it, but then it automatically changes itself to MILONIC every single time. Can't seem to figure out what the heck makes it do that.

--Is there any way to have the menu always be a specfic width and to wrap if the line gets too long? THe image I am using is a specific size and needs to display the whole thing or it looks dumb.

--Is there any way to have the picture stretch itself to fit the size of the wording (1 line, 2 lines, etc)?

Just some initial things I'm thinking of.

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

Post by Ruth »

1. If you're getting the milonic link, it sounds like you do not have a licensed version yet.

2. You can set the itemwidth=10; or whatever number you need.

Code: Select all

with(milonic=new menuname("Main Menu")){
style=background;
top=10;
left=10;
alwaysvisible=1;
itemwidth=50;
This means the item is 50px and anything that goes beyond that will wrap. So just set the menu size to the image size, but remember if you have any padding listed in the defined style.

3. The item bgimage will repeat, but you have to keep in mind that if your image has edges then if it repeats twice it will look like two images that have no space between but still two images. I suggest you open the sample menu_data.js file and add that itemwidth=50; to the main menu and then type in a bunch of works after the word HOME, save it and then open the menu.htm file that came with it and you will be able to see what happens. It will give you an idea.

It would be easier to help if you had even a test page up with your menu and the image to be able to see what you have.

Ruth
kelemvor
Super Advanced
Super Advanced
Posts: 39
Joined: Mon Jun 17, 2002 2:05 am

Post by kelemvor »

OK, Itemwidth is what I was looking for. and yeah, I figured the image would repeat and look stupid which is why I didn't know if it could be set to Stretch the image instead of just repeating.

But I am doing all this on a test area so I can see how it works so we'll be fine.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

You might be able to fix your image so it matched in such a way as to not look as if it were repeating. I'm not sure if the menu has a way to set a norepeat and then make sure the back ground is set then you could code it to be 'centered' in the image item with a surrounding background, but I'm not sure you can do that inside a menu item. But, it's a question I think I will ask in the forum.


Ruth
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

If it doesn't matter if your image looks 'stretched', try imagewidth to match itemwidth.
John
kelemvor
Super Advanced
Super Advanced
Posts: 39
Joined: Mon Jun 17, 2002 2:05 am

Post by kelemvor »

Can I put the ITEMWIDTH somewhere in the file that I only have to put it once and not for each sub menu too?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

itemwidth is also a Style property.

I would suggest a reading assignment - http://milonic.com/forum/viewtopic.php?t=2981. :roll:
John
Post Reply