PDA

View Full Version : Resolved Chrome menu positioning



-jw-
05-06-2009, 09:28 AM
1) Script Title: Chrome CSS Drop Down Menu (v2.5)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/chrome/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

-jw-
05-06-2009, 10:15 AM
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.