Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: AnyLink Drop Down Menu

  1. #1
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default AnyLink Drop Down Menu

    AnyLink Drop Down Menu

    http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    I was wondering if anyone knows how to reverse the menu direction?

    I have it working great as a drop down but the second page I have it on the nav bar near the bottom and I need it to go up not down, and the page isnt small enough to force the menu up.

    Any help with this would be great.

    -- Nate

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The script should dynamically do this already if there isn't enough room below the anchor link to drop down fully. I reckon you wish to add the option of manually forcing the menu to drop up. If so, find the line:

    Code:
    function dropdownmenu(obj, e, menucontents, menuwidth){
    and change that to:

    Code:
    function dropdownmenu(obj, e, menucontents, menuwidth, dropupBool){
    Then find the line:

    Code:
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
    and change that to:

    Code:
    if (dropupBool==true)
    dropmenuobj.style.top=dropmenuobj.y-dropmenuobj.offsetHeight+"px"
    else
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
    Then, in your HTML, to force a menu to drop down, just populate the optional 5th parameter with "true":

    Code:
    <a href="default.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '150px', true)" onMouseout="delayhidemenu()">Web Design</a>

  3. #3
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    That worked perfect, thanks so much for the help.

    -- Nate

  4. #4
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    *New issue with the drop ups*

    ddadmins help did work, but I now noticed in Firefox the menus that roll up (the help I got) the menus cut halfway in the button they come from.

    Any help with this would be great. I can provide a link if that helps.

    -- Nathan
    Last edited by nate51; 01-04-2008 at 07:15 PM.

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Sounds like a z-index issue, but yes, please post a link to the problem page.

  6. #6
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Here is a link to the issue, I had to strip the page for privacy issues. As you can see in Internet Explorer it works fine but in FireFox it doesnt.

    http://ne-media.com/example/

    Thank you for your help.

    -- Nate

  7. #7
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    I tried looking through the code and I am not sure what a "z-index" is.

  8. #8
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    *bump
    If anyone has any insight or advice I could use it. I have a deadline for this and am in need of help with this.

  9. #9
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Ok, based on the link you provided, this isn't an issue with z-Index. It seems your layout for some reason is throwing off Firefox's calculation of where those image buttons on your page are located y coordinates wise from the upper left edge of the page. The easiest way right now to fix this seems to just be to detect for Firefox, and compensate manually for this discrepancy. Find the lines:

    Code:
    if (dropupBool==true)
    dropmenuobj.style.top=dropmenuobj.y-dropmenuobj.offsetHeight+"px"
    and change that to:

    Code:
    if (dropupBool==true)
    dropmenuobj.style.top=dropmenuobj.y-dropmenuobj.offsetHeight+(/firefox/i.test(navigator.userAgent)? -obj.offsetHeight : 0)+"px"
    The part in red is new.

  10. #10
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    ddadmin,

    That worked great, thank you so much for the help. I hope I can repay you one day.
    Hopefully someone else can benefit from this post also.

    -- Nate

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
  •