M
mrengler2
I have a web page written in asp.net/c# which can be fairly long, so
users scroll down. When they click a button, an asp created control is
displayed to the user, and the coordinates are set via javascript. I
currently use (document.body.clientHeight - offset) / 2 (and
window.outerWidth for firefox) to display the control vertically
centered. However, this doesn't work when the user scrolls down.
When the user scrolls down, those coordinates point towards the top,
which was the height of the window. I need to get the coordinates of
the vertical center of the screen regardless of how far the user
scrolls so that they always see this control in the center of the
screen. How can I do this?
MSIE 6 and 7 are my primary concern, and firefox is a less important
concern.
users scroll down. When they click a button, an asp created control is
displayed to the user, and the coordinates are set via javascript. I
currently use (document.body.clientHeight - offset) / 2 (and
window.outerWidth for firefox) to display the control vertically
centered. However, this doesn't work when the user scrolls down.
When the user scrolls down, those coordinates point towards the top,
which was the height of the window. I need to get the coordinates of
the vertical center of the screen regardless of how far the user
scrolls so that they always see this control in the center of the
screen. How can I do this?
MSIE 6 and 7 are my primary concern, and firefox is a less important
concern.