PDA

View Full Version : Image in hv menu doesn't appear?



Rosemarie Lanaro
06-27-2005, 02:20 AM
HV Menu
http://www.dynamicdrive.com/dynamicindex1/hvmenu/index.htm

This script allows an image as background but I cannot seem to get that to work.

MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width);

What is the correct form for the image to load, there is a note in the instructions to Enable in menu_com.js but there is no explanation or instruction.
I have tried img src in a number of variations but the image never appears.

I would love to use the rollover feature as well but couldn't get that to work either.

Please help

Rose

jscheuer1
06-27-2005, 09:17 AM
That bit about enable in menu_com.js is only an instruction for those folks that want to try to use this feature in Netscape version 4. You do not need to worry about it. Now, let's get back to exmplmenu_var.js and using background images. It is simpler than you are making it out to be. Here is an example menu entry without the background image:
Menu2_1=new Array("General","blank.htm","",5,20,150);and here is the same one with a background image:
Menu2_1=new Array("General","blank.htm","some.gif",5,20,150);The image must be in the same directory as exmplmenu_var.js or use an absolute path, like:
Menu2_1=new Array("General","blank.htm","http://www.somewhere.com/images/some.gif",5,20,150);If you want the same background image for all the menu items and don't want to spend the time editing each entry, then you can open up menu_com.js and go to line #395:
if(eval(WhatMenu+'[2]'))this.style.backgroundImage="url(\'"+eval(WhatMenu+'[2]')+"\')";Change it to something like this:
this.style.backgroundImage="url(\'some.gif\')";