Results 1 to 3 of 3

Thread: Chromemenu within a container

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

    Default Chromemenu within a container

    When I put the menu items definition within a DIV <div style="position:absolute; top:100px">, the dropdown menus are appearing with an extra offset down.

    How to fix that ? Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Try relative position for the container, or better yet just use the default positioning as intended for use with this menu.

    If you have to use an absolutely positioned container. Here is where in the script (chrome.js) the top position is set:

    Code:
    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
    If the 'extra offset down' is the same for all items, just subtract it in the above line (like if it is the 100 you used to position the container):

    Code:
    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1-100+"px"
    But, be aware, different browsers may look at this differently and various adjustments may need to be made for each one, that would be a bit more complex.
    - John
    ________________________

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

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

    Smile

    Thanks Mad Prof.
    Well, strangely, the negative offset corresponding to the absolute top position of the div container does not force the dropdown menu to stick exactly below the main bar, in IE/Netscape. In the end, probably it is better to use relative position after the top other stuff. But I have to change many things because everything is ouput by PHP.
    Anyway thank you for this prompt anwser, the question is closed.

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
  •