Image and bgimage together.

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
devzero
Beginner
Beginner
Posts: 5
Joined: Sat Nov 27, 2004 10:04 pm

Image and bgimage together.

Post by devzero »

I have been looking around the forums for a solution to this, but could not find anything so i thought I would ask here.

I want to put an image before each tekst, and a background image on each menu item. Here is the code im using:

image="resources/images/btn_blue.gif";
bgimage="resources/images/buttonMiddleOn.gif";

When i have one or the other they show just fine, but when i use both, only the "image" shows.

------------------------------------
Also, is it possible to have a background image, a left image and a right image?
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 haven't played around with all the image options in a while, so I can't really answer your question.

Its probably best to test images in different positions, don't forget there may be a difference between menu item and style. I remember sometimes placing the image in the menu item.

the only other thing I can think of is text=........;type=html; placing html in text, I don't know what will happen with all the images.

Check other browsers too.

maz
devzero
Beginner
Beginner
Posts: 5
Joined: Sat Nov 27, 2004 10:04 pm

Post by devzero »

I tried adding "image=resources/images/buttonMiddleOn.gif;" while keeping the bgimage="resources/images/buttonMiddleOn.gif"; in the with(menuStyle=new mm_style()){ block. This made no diffrence. I am testing the menu in firefox 1.0 and explorer 6.0 (and i dont realy care if its working or not in any other browser besides those 2)

Plasing the image tag inside the Text, works, sorta. I get some padding/border/margin that i can't seem to get rid of, but i guess ill manage sooner or later:)
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

A url might be helpful, and are you sure you have the latest version of the menu?

maz
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

I just tested the menu with both bgimage and image and it worked fine.

Are you sure the image locations are correct.

Cheers
Andy
devzero
Beginner
Beginner
Posts: 5
Joined: Sat Nov 27, 2004 10:04 pm

Late answer...

Post by devzero »

Andy:
I am very sure the image locations are correct. When I comment out like this:

//image="resources/images/btn_blue.gif";
bgimage="resources/images/buttonMiddleOn.gif";

The correct background image shows. When i use the code on top:

image="resources/images/btn_blue.gif";
bgimage="resources/images/buttonMiddleOn.gif";

Only the blue button shows.

Maz:
Ive made a test page. Im running the latest version, downloaded it the same day i made the first post in this thread.

What I want is the effect I get on the sub menu's on the main menu also.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Actually you're quite a bit downlevel. You have 5.47 posted - current is 5.62. Try an upgrade and let us know.
John
devzero
Beginner
Beginner
Posts: 5
Joined: Sat Nov 27, 2004 10:04 pm

Post by devzero »

Must have been partialy asleep... im running 5.60 on my development machine, where i have the same problem. Apparently forgott to uppdate my production system :)

Anyway, I have uppdated my production and development system to 5.62 now, and still have the same problem.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

is it possible to have a background image, a left image and a right image?
Yes, you can do it if you set it up as html code for the images, i.e.

Code: Select all

aI("text=<img src=btn_blue.gif border=0 align=top>Home<img src=btn_blue.gif border=0 align=top>;
If you do it, to have space between the left image and the text you can use a non breaking line space, however you cannot use a non breaking line space and then the image on the right side. I don't know why probably something to do with the semi-colon in it, but it stops anything from showing, so you'd need to make the right side image with some blank space at the left of it.

As to the other question on the image and the bgimage. They should work. I've tested them on a number of different pages and it works, however I cannot get them to work on yours. I do not know why and since I don't know functions and such I don't know how to figure out what's causing it.

Ruth
devzero
Beginner
Beginner
Posts: 5
Joined: Sat Nov 27, 2004 10:04 pm

Post by devzero »

I have managed to get it to work with the HTML code for the images inserted in the Ai function. This is not an ideal way of doing it for me, as I have multiple web sites generated by the same .net code. The code for generating the Ai statement is in the compiled code, and thus needs a recompile for each chang. Plus it needs specialy inserted logic into the .cs file (since not all sites are going to use the image in the menu). The image / bgimage are in .js files and can be modified by a designer and you dont need a recompile to do it.

Also another problem, I would like to have a left and a right picture, witch are left and right aligned, and swapable by mouseover/click. This would give the opportunity to dynamiclay create 3D looking buttons.


Thanx for all your help so far.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I think you may need to contact Milonic direct as to the bgimge and image problem. I don't know about the compiled code and I think that may be causing some of the problem because I used your menu on a test page I created, putting your menu data into a data.js file and calling it and it works fine showing both the bgimage and the image. So, that indicates that something on your page is causing the problem [or perhaps in how the code is compiled].

As to the other request on the mouseover and changing I will try and see if I can figure out how to do something like that and post back here.

Ruth
Post Reply