Results 1 to 2 of 2

Thread: Chrome menu positioning

  1. #1
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Chrome menu positioning

    1) Script Title: Chrome CSS Drop Down Menu (v2.5)

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

    3) Describe problem:

    I think the script currently positions the drop down menus relative to the position of the a tag you hover over in the main navigation. I would like to have all drop down menus positioned in the same place, I have been trying for hours to position to a different element such as another div but can’t seem to get it to work once you resize the browser window, can anyone help me out please.

    An example of what I’m doing can be seen here - http://92.52.79.191/shwlondon.co.uk/nav.html.

    Sorry bbut I’m not to good with javascript.

    Thanks in advance

    jw
    Last edited by Snookerman; 05-06-2009 at 11:14 AM. Reason: added “Resolved” prefix

  2. #2
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    always the way...you post a thread and then finally fiqure it out yourself.

    In case this helps anyone else then I made the following changes to the javascript.

    I added this line in the dropit function

    var offsetLeftNav = document.getElementById("container").offsetLeft+18;

    above these lines

    this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"

    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+-1+obj.offsetHeight+"px"

    which gets the amount of pixels from the left of the browser edge I want the navs to be.

    I then changed these lines

    this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"

    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+-1+obj.offsetHeight+"px"

    to

    this.dropmenuobj.style.left=offsetLeftNav+"px"
    this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+-1+obj.offsetHeight+"px"

    Thanks anyway.

    jw.

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
  •