Results 1 to 2 of 2

Thread: Image in hv menu doesn't appear?

  1. #1
    Join Date
    Jun 2005
    Location
    Long Island
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Image in hv menu doesn't appear?

    HV Menu
    http://www.dynamicdrive.com/dynamici...menu/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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:
    Code:
    Menu2_1=new Array("General","blank.htm","",5,20,150);
    and here is the same one with a background image:
    Code:
    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:
    Code:
    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:
    Code:
    if(eval(WhatMenu+'[2]'))this.style.backgroundImage="url(\'"+eval(WhatMenu+'[2]')+"\')";
    Change it to something like this:
    Code:
    this.style.backgroundImage="url(\'some.gif\')";
    Last edited by jscheuer1; 06-27-2005 at 09:40 AM. Reason: add info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •