bgimage doesn't appear until mouseover

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
randal
Beginner
Beginner
Posts: 1
Joined: Mon Aug 09, 2004 11:08 am

bgimage doesn't appear until mouseover

Post by randal »

Hey,

I've configured a menu to have a bgimage and an overbgimage, and it works fine, except the bgimage for each menu doesn't appear until I've mouseover'd each menu., after that its okay, until I refresh the page and they all disappear again.

Problem appears in Firefox 0.9.2 and IE 6.0.2, using menu version 5.39 - Built: Thursday August 5 2004 - 10:02

My code:

with(menuStyle=new mm_style()){
oncolor="#FFFFFF";
offcolor="#FFFFFF";
bordercolor="#000000";
borderstyle="solid";
borderwidth=1;
padding=5;
fontsize="11";
fontstyle="normal";
fontweight="bold";
fontfamily="Arial";
}

with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=74;
left=0;
alwaysvisible=1;
orientation="horizontal";
itemwidth=110;
aI("text=Menu 1;url=#;bgimage='../images/menu_background.gif';overbgimage='../images/menu_background_inverted.gif';");
aI("text=Menu 1;url=#;bgimage='../images/menu_background.gif';overbgimage='../images/menu_background_inverted.gif';");
aI("text=Menu 1;url=#;bgimage='../images/menu_background.gif';overbgimage='../images/menu_background_inverted.gif';");
aI("text=Menu 1;url=#;bgimage='../images/menu_background.gif';overbgimage='../images/menu_background_inverted.gif';");
aI("text=Menu 1;url=#;bgimage='../images/menu_background.gif';overbgimage='../images/menu_background_inverted.gif';");
aI("text=Menu 1;url=#;bgimage='../images/menu_background.gif';overbgimage='../images/menu_background_inverted.gif';");
aI("text=Menu 1;url=#;bgimage='../images/menu_background.gif';overbgimage='../images/menu_background_inverted.gif';");
}

Also, seeing as all my images are the same, is there a quicker way of defining this? (i.e. not specifying the images in each menuitem)

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

Post by John »

bgimage= and overbgimage= are also Style properties. Put the statements there (I suspect a trip to the docs is in order!). Up there use " " around the path.
John
stuarth
Advanced
Advanced
Posts: 14
Joined: Fri Oct 22, 2004 12:17 am
Location: UK

Post by stuarth »

I am having a similar problem.

Can you correct my problems below?

<SCRIPT type=text/javascript>
with(milonic=new menuname("Main Menu")){
style=MainmenuStyle;
top=83;
left=165;
alwaysvisible=1;
orientation="horizontal";
aI("image=images/why_bc_off.gif;overimage=images/why_bc_on.gif;url=why_blue_cube.htm;showmenu=whybluecube;status=Why Blue Cube?;imagewidth=111;imageheight=25;");
aI("image=images/prd_off.gif;overimage=images/prd_on.gif;url=products.htm;showmenu=products;status=Products;imagewidth=68;imageheight=25;");
aI("image=images/srv_off.gif;overimage=images/srv_on.gif;url=services.htm;showmenu=services;status=Services;imagewidth=66;imageheight=25;");
aI("image=images/sup_off.gif;overimage=images/sup_on.gif;url=support.htm;showmenu=support;status=Support;imagewidth=64;imageheight=25;");
aI("image=images/cas_off.gif;overimage=images/cas_on.gif;url=case_studies.htm;showmenu=casestudies;status=Case Studies;imagewidth=94;imageheight=25;");
aI("image=images/co_off.gif;overimage=images/co_on.gif;url=company.htm;showmenu=company;status=Company;imagewidth=96;imageheight=25;");
aI("image=images/nws_off.gif;overimage=images/nws_on.gif;url=news.htm;showmenu=news;status=News;imagewidth=50;imageheight=25;");
aI("image=images/con_off.gif;overimage=images/con_on.gif;url=contact.htm;showmenu=contact;status=Contact;imagewidth=63;imageheight=25;");
}
drawMenus();
</SCRIPT>
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Locate "preloadimages.js" that might help.

maz
stuarth
Advanced
Advanced
Posts: 14
Joined: Fri Oct 22, 2004 12:17 am
Location: UK

Post by stuarth »

shouldnt the images load without preload? The timing of the images loading is not a problem. The images dont load at all until I roll over them. This isnt a preload problem.

Can anyone help?
Post Reply