Log in

View Full Version : How I change the align of AnyLink Drop Down Menu



mk4th
10-18-2007, 01:36 PM
1) Script Title:
AnyLink Drop Down Menu

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

ddadmin
10-19-2007, 05:50 AM
Try the changes in red to the original code below:


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

mk4th
10-19-2007, 12:08 PM
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.

mk4th
10-19-2007, 12:49 PM
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

mk4th
10-20-2007, 09:11 PM
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