Results 1 to 4 of 4

Thread: AnyLink Drop Down Menu- customize bg color

  1. #1
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question AnyLink Drop Down Menu- customize bg color

    The script is: http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    Question: Is there any way to customize the script so that each Menu Option has a different bg color? There is a way to set a bgcolor, however, it is set once and for all options. I can create each sub-menu topic as an image with the correct bgcolor that I want, but for ease of maintenace, it would be easier to just have to update text and not an image.

    Thanks.

  2. #2
    Join Date
    Sep 2004
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AnyLink Background Colors

    Yes, it's possible to put individual background colors in the menus. You have to edit the script. I've gotten it to work in both IE and FF, but it's something of a hack, so use it at your own caution. Here we go.

    First, pass in the desired color in the onMouseOver:

    Code:
    onMouseover="dropdownmenu(this, event, menu0, '130px', '#BF8718')"
    In this case, I've added the #BF8718 into the array.

    Next you need to add some code into into the AnyLink script itself. Add the variable, menucolor at the end of the variable array in the dropdownmenu function, like so:

    Code:
    function dropdownmenu(obj, e, menucontents, menuwidth, menucolor)
    Then we need to rewrite the div tag with the new bg color, so add the code below as the first two lines in the dropdownmenu function like I've done below:

    Code:
    newText = '<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menucolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>';
    document.getElementById("changeDropmenudiv").innerHTML = newText;
    That should be it.

    Regards,
    bfisher

  3. #3
    Join Date
    Feb 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi

    I tried this out with http://www.dynamicdrive.com/dynamici...pmenuindex.htm.

    I did exactly with the instructions above, but it's not working...

    Somebody has another idea how doing this?

    Thanks
    Lasso

  4. #4
    Join Date
    Nov 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I found this old thread when searching the forums for an answer to the same problem.

    My solution, if it helps anyone out there:

    http://www.dynamicdrive.com/forums/s...962#post119962

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
  •