468,268 Members | 1,747 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,268 developers. It's quick & easy.

Positioning a popup relative to a table cell

Some of the cells in my ASP.NET 2 table have a popup that appears when the
user hovers the mouse over a text area that is indicated using an anchor
tag. The popup is implemented as a DIV tag (position: relative) and is
displayed and hidden using Javascript which calculates the popup position.

The table has vertical scrollbars and when the table is scrolled to the very
top then the popup is positioned correctly. However, if the table is
scrolled then the vertical positioning is incorrect and the popup isn't
visible at all.

Could someone help me out with the Javascript algorithm for setting the
popup position? I've looked at the DOM properties (offsetTop etc) but I
can't get a working algorithm that takes into account the scrollbar
position.
Jun 27 '08 #1
1 1848
On Jun 14, 1:49 pm, "chris f" <chrisfell...@nospam.co.ukwrote:
Some of the cells in my ASP.NET 2 table have a popup that appears when the
user hovers the mouse over a text area that is indicated using an anchor
tag. The popup is implemented as a DIV tag (position: relative) and is
displayed and hidden using Javascript which calculates the popup position.

The table has vertical scrollbars and when the table is scrolled to the very
top then the popup is positioned correctly. However, if the table is
scrolled then the vertical positioning is incorrect and the popup isn't
visible at all.

Could someone help me out with the Javascript algorithm for setting the
popup position? I've looked at the DOM properties (offsetTop etc) but I
can't get a working algorithm that takes into account the scrollbar
position.
Hi,,,,

this is the property you need to adjust

document.body.scrollTop

add this to your logic where you set "Y" postion

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Joe Conlin | last post: by
1 post views Thread by Chris McGarry | last post: by
1 post views Thread by Bart Lateur | last post: by
8 posts views Thread by active | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.