Results 1 to 5 of 5

Thread: How I change the align of AnyLink Drop Down Menu

  1. #1
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How I change the align of AnyLink Drop Down Menu

    1) Script Title:
    AnyLink Drop Down Menu

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Describe problem:
    How can I center the the menu to the middle of somthing?

    Well, I tried somthing like:
    function fixOffset(){
    var cellID = window.event.srcElement;
    if (cellID.tagName != "TD")
    cellID = window.event.srcElement.parentElement;
    return (cellID.offsetWidth/2-65); //65 it is half the menu width
    }
    And I have changed that:
    dropmenuobj.x=getposOffset(obj, "left")+fixOffset();

    but it is working only for IE... FF says nop.
    thanks
    MK

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

    Default

    Try the changes in red to the original code below:

    Code:
    dropmenuobj.style.left=dropmenuobj.x-(dropmenuobj.offsetWidth/4)-clearbrowseredge(obj, "rightedge")+"px"

  3. #3
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Not working

    Not working for me. It still on the left.

    May I explain myself better. The menu is place within <TD> and I want it too "spring" in the middle of the cell.

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

    Default

    Found it!

    It is:
    +(obj.offsetWidth/2-menuwidth/2) //Set to 65 in my code

    "dropmenuobj" is constant value, set by "menuwidth" (130 in my case).

    My solution pushes menu to the center, and taking it back by "menuwidth/2" (65 in my case)..

    Thanks for the direction.
    MK

  5. #5
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Another problem.
    It somtimes disappears without any reason. Its trigged by click, and not allways you can hover above it, and it will be there for you.

    Problem with both FF and IE...

    P.S. I have PC and not Mac. Time and "hidemenu_onclick="no"" just didn't made anything.


    My site for exaple (not in English, but does not matters). In the DD script page, its workinkg fine.
    http://mk4.phpnet.us/Index.htm
    Last edited by mk4th; 10-20-2007 at 09:43 PM.

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
  •