Advanced Search

Results 1 to 3 of 3

Thread: Can't get AnyLink Drop Down Menu to work...

  1. #1
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can't get AnyLink Drop Down Menu to work...

    1) Script Title: AnyLink Drop Down Menu

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex1/dropmenuindex.htm

    3) Describe problem:
    I'm a scripting newbie, and I've been able to get the other ones to work, but I can't figure this one out for the life of me, and I get errors saying 'menu1' is not defined.

    I'm determined to have a drop down menu with image rollovers as menu items. I looked everywhere for a script that does both of these things, but to no avail. I made the mouseovers in Imageready and it's my first time using the code from there.

    Here is sample code in the head of the document that is supposed to make the menu items be rollovers:

    var menu1=new Array()
    menu1[0]='<a href="new.html" ONMOUSEOVER="changeImages('new', 'images/new-over.gif'); return true;"
    ONMOUSEOUT="changeImages('new', 'images/new.gif'); return true;">
    <IMG NAME="new" SRC="images/new.gif" WIDTH=93 HEIGHT=18 BORDER=0 /></A>
    <IMG SRC="images/groups_02.gif" WIDTH=57 HEIGHT=18 />'



    And here is the code for the link that when moused over, should produce the menu:
    <TD><A HREF="shop.html" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '220px')" onMouseout="delayhidemenu()">
    <IMG NAME="shop" SRC="images/shop.gif" WIDTH="43" HEIGHT="15" BORDER="0"></A></TD>


    I know this is probably too complicated to diagnose, but might anyone be able to tell me if I'm missing something glaringly obvious?

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    I see one thing that could cause the menu to not show up. Take a look at the following:

    Code:
    menu1[0]='<a href="new.html" ONMOUSEOVER="changeImages('new', 'images/new-over.gif'); return true;"
    ONMOUSEOUT="changeImages('new', 'images/new.gif'); return true;">
    <IMG NAME="new" SRC="images/new.gif" WIDTH=93 HEIGHT=18 BORDER=0 /></A>
    <IMG SRC="images/groups_02.gif" WIDTH=57 HEIGHT=18 />'
    Should be something like this:

    Code:
    menu1[0]='<a href="new.html" ONMOUSEOVER="changeImages(\'new\', \'images/new-over.gif\'); return true;"
    ONMOUSEOUT="changeImages(\'new\', \'images/new.gif\'); return true;">
    <IMG NAME="new" SRC="images/new.gif" WIDTH=93 HEIGHT=18 BORDER=0 /></A>
    <IMG SRC="images/groups_02.gif" WIDTH=57 HEIGHT=18 />'
    Notice how the single quotes in the second snippet are escaped (with the backslash). As for the menu1 not defined thing, is there a link to the problem page that we could look at. It could be another javascript causing that error or something. Just some suggestions.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the suggestions. I put in the backslashes and nothing new happened. I just uploaded the page here:

    http://www.porkchopgirl.com/home.html

    Please ignore the filler image and the white spaces Imageready gave me. I'll remove those later.

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
  •