Forum Moderators: not2easy
This problem is for IE7. Additional help on other browsers is welcome.
Thanks in advance!
<div id="outer" style="position: absolute; top:50%; width:100%; overflow:visible;
height:1px; margin: 0; ">
<div id="dest" style="position: absolute; border: solid 1px #336699; width: 400px; height: 500px;
visibility: hidden; background-color: white; z-index: 100; padding: 5px 5px 5px 5px;
text-align: center; vertical-align: middle">
</div>
</div> <!-- outer div -->
JS:
var myDiv = document.getElementById ('dest');
(g_ele is the global variable representing the image within the HTML table that is being clicked)
From here I am trying to position myDiv. I have tried to get a meaningful value for the distance from the top of the document to the top of the viewport, but can't. I've tried:
window.scrollY
document.documentElement.scrollTop
document.documentElement.offsetTop
myDiv.scrollTop
window.scrollTop
g_ele.offsetTop (computed by iterating and accumulating the g_ele.offsetParent values)
myDiv.offsetHeight
myDiv.offsetTop
Right now I'm without a workable strategy, but I think the answer is in finding the y-position of the top of the viewport. I just don't know how to do that.