Results 1 to 5 of 5

Thread: AnyLink CSS Menu: change the position of the menu

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

    Question AnyLink CSS Menu: change the position of the menu

    Script: AnyLink CSS Menu
    http://www.dynamicdrive.com/dynamici...anylinkcss.htm

    Hello . Is there a way to change the position where this menu appears. If it possible to display it, not below the link, but at the end of it, as AnyLink Vertical Menu does ( http://www.dynamicdrive.com/dynamici...nkvertical.htm )?

    Thank you!

  2. #2
    Join Date
    Mar 2006
    Location
    UK, warwickshire
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    my i just ask y you cant use http://www.dynamicdrive.com/dynamici...nkvertical.htm
    instead of your other code? im sure there is a reason but the best way just seems to be use the new code

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,136
    Thanks
    44
    Thanked 3,231 Times in 3,192 Posts
    Blog Entries
    12

    Default

    Here is where, in anylink.js that the drop downs are revealed and their position is set:

    Code:
    function dropdownmenu(obj, e, dropmenuID){
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    if (typeof dropmenuobj!="undefined") //hide previous menu
    dropmenuobj.style.visibility="hidden"
    clearhidemenu()
    if (ie5||ns6){
    obj.onmouseout=delayhidemenu
    dropmenuobj=document.getElementById(dropmenuID)
    if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
    dropmenuobj.onmouseover=clearhidemenu
    dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
    showhide(dropmenuobj.style, e, "visible", "hidden")
    dropmenuobj.x=getposOffset(obj, "left")
    dropmenuobj.y=getposOffset(obj, "top")
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
    }
    return clickreturnvalue()
    }
    The line in red sets their left position. You could simply add some on:

    Code:
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+100+"px"
    Or, for what you want, the right edge of the trigger may need to be found. Let me know if the above is good enough. This may get the trigger width:

    Code:
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
    untested.
    - John
    ________________________

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

  4. #4
    Join Date
    Feb 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nop, It does not work. The menu appears randomly along the link (sometimes at the begining, other times in the middle, few times almost at the end!!!).

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,136
    Thanks
    44
    Thanked 3,231 Times in 3,192 Posts
    Blog Entries
    12

    Default

    That's funny, it works here.
    - 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
  •