View Full Version : Position of pop up layer

11-13-2002, 09:37 AM
I'm making a drop down style menu with all menu links using the same layer.
However, I need to position the layer differently, depending on what link is clicked!

My layer looks like this:
<div id="details" name="details" style="position: absolute; width: 250px; height: 75px; visibility: hidden; background-color: black; color: white; font-family: verdana; font-size: 10px">

How can get the X and Y coordinates of the link so I can set the div's TOP and LEFT to show it on the right place?


Mr J
11-13-2002, 03:13 PM
The following will move your layer.

ID, X, and Y positions are passed to the function via the link

function show(id,X,Y){

<a href="javascript:show('details',100,100)">Link 1</a>
<a href="javascript:show('details',100,200)">Link2</a>

11-13-2002, 03:29 PM
but I see now that my question was badly formed.
Links are from a database-generated list, I don't know the coordinated.
That's the real problem, I know how to position the layer - but I don't know how to get the coordinates of the link.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum