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

Thread: Anylink drop down menu, moving it to the right?

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

    Post Anylink drop down menu, moving it to the right?

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

    the script works wonderfully, but I have a question regarding to its position, instead of dropping down right underneath, is it possible of moving it to pop on the right side instead?

    /cheers!

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

    Default

    Well, the line:

    Code:
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
    controls the left offset of the menu. To make the menu appear to the right of the link, you can modify it to:
    Code:
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
    The addition of "obj.offsetWidth" increases the left offset to include the width of the link itself.

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

    Default

    Thanks ddadmin !!!!

  4. #4
    Join Date
    Sep 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This is great! Any way to get it to move only slightly to the right, and not clear to the right edge of the link? Like a certain number of pixels?

  5. #5
    Join Date
    Sep 2004
    Location
    Indonesia
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If You want to move 10 pixels to the right :
    Code:
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+10+"px"

  6. #6
    Join Date
    Sep 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Amazing how simple that is. Thank you very much!

  7. #7
    Join Date
    Sep 2004
    Location
    Indonesia
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You're welcome

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

    Default

    Along the same lines, is there a way to align it at the top of an object? I ask because I've put the rollover code in a table cell and would like the menu to display at the to and to the right of the cell. Thanks in advance. Keep up the great work!

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

    Lightbulb

    I answered my own question. Just goes to show that when you get to the point where you want to quit. Swear at it a little bit and then try again!

    Here's what I did:

    On this line,
    Code:
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottom")+obj.offsetHeight+"px"
    Remove:
    Code:
    +obj.offsetHeight+"px"
    Voila!

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

    Default

    I have the same question but regarding to the position of Pop-it menu

    http://www.dynamicdrive.com/dynamicindex1/popit.htm

    Where is, I suppose, no dropmenuobj. Also how can I align the sub-menu to the right.

    Thanks

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
  •