tags:

views:

30

answers:

0

Hi, I am trying to use jQuery to position an inpage div (Context-Menu) relative to a clicked tablerow on a webpage. This works fine until I add an offset with either "left" or "margin-left" to the outer container. Using padding-left works....

The relevant code is:

$('#supermenu').position({
my: "left top",         
at: "left top",
of: $(event.target).closest('tr'),
collision: "fit" });

The caller looks like:

<tr onclick="getMenu(event)"><td>....

What happens: The left margin is added "twice" to the X Offset, so the Menu is not aligned to the left border of the table but somewhere right of it. The offset from the border is exactly the offset from the outer container.

Anybody can shed some light?

Oliver