Posted on: 9/1/2014 9:58:45 PM | Views : 385

Apologies if this is a thread elsewhere, however I am having trouble aligning a floating div to the correct position which depends where the use is on the page.
If you have a look at twitter photo viewer (which pops up in an overlay) no matter where the user is on the page (vertically) the div is aligned to the viewport of the browser at that particular height/offset.
I have tried using overlayDiv.clientTop = window.pageYoffset however it doesnt work.
What i thought was strange is that Web Developer and javascript pickup the offset value and it changes depending how far up or down the page you are but it wont allow me to set the div position. the clientTop always returns 0 or null;
My overlayDiv is located in the masterPage file.
A user visits the profile page and licks a small photo thumbnail to enlarge the photo.
The javascript code is fired and doesnt crash, because the last line is to make the overlayDiv visible, and this works f ...

Go to the complete details ...