ScrollTop don't work on Window.Open

S

SuNcO

Ok, i have a code that need to show a DIV on X and Y position. The next
code works fine :

<script language="JavaScript">
var IE = document.all?true:false;

if (!IE) { document.captureEvents(Event.MOUSEMOVE); }

document.onmousemove = getMouseXY;

var tempX = 0;
var tempY = 0;

function getMouseXY(e) {
if (IE) {
tempX = event.clientX + document.body.scrollLeft;
tempY = event.clientY + document.body.scrollTop;
} else {
tempX = e.pageX;
tempY = e.pageY;
}

if (tempX < 0){ tempX = 0; }
if (tempY < 0){ tempY = 0; }

document.Formulario.MouseX.value = tempX;
document.Formulario.MouseY.value = tempY;
}
</script>

The position is put on a Form (to test). Ok, the problem now is that
when i do the same thing with a window.open then not work. If i move
the scrollbars the ScrollTop is always to 0 then tempY is wrong

I open the window with this :

window.open('file.php','whatever','width=790,height=530,scrollbars=yes,
dependent=yes');
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top