Hi,
I'm putting together a site which has a list of items, each of which has a mouseover event that pops up a layer at the position of the mouse cursor. This works fine until I scroll down the page. Then, when the mouse rolls over a link, the following scenario occurs: although the link may be near the bottom of the document, it may be near the top of the visible window and the layer pops up the same distance from the top of the document that the cursor is below the top of the visible window. This means that the layer instances associated with links lower down the page are never visible, because they are too close to the top of the document and therefore have been scrolled off.
Code extract:
============================
function showDescription (svc, text) {
// this just makes the layer visible - it works
setLayerVisibility ('popupText', 'visible');
document.all.popupText.style.left = window.event.x;
document.all.popupText.style.top = window.event.y;
}
============================
I need to position the layer from the reference point of the window, rather than the document, or get the x and y coordinates of a mouse event with respect to the document, rather than the window. Any ideas on how to do this?
Thanks,
Jon Daniels
Browser version: MSIE 6.0.2600
I'm putting together a site which has a list of items, each of which has a mouseover event that pops up a layer at the position of the mouse cursor. This works fine until I scroll down the page. Then, when the mouse rolls over a link, the following scenario occurs: although the link may be near the bottom of the document, it may be near the top of the visible window and the layer pops up the same distance from the top of the document that the cursor is below the top of the visible window. This means that the layer instances associated with links lower down the page are never visible, because they are too close to the top of the document and therefore have been scrolled off.
Code extract:
============================
function showDescription (svc, text) {
// this just makes the layer visible - it works
setLayerVisibility ('popupText', 'visible');
document.all.popupText.style.left = window.event.x;
document.all.popupText.style.top = window.event.y;
}
============================
I need to position the layer from the reference point of the window, rather than the document, or get the x and y coordinates of a mouse event with respect to the document, rather than the window. Any ideas on how to do this?
Thanks,
Jon Daniels
Browser version: MSIE 6.0.2600