Autor Zpráva
grull
Profil *
Mám takovej skript, mělo by to vypisovat souřadnice kurzoru ale nic to nedělá nevíte někdo jak to
<script language="Javascript" type="text/javascript">

function getMousePos ()
{
alert ('x=' + e.pageX + " y=" +e.pageY);
document.write(x & y) ;
}







</script>
<body onmousemove = getMousePos(); >
</body>
nightfish
Profil
function doSomething(e) {

var posx = 0;
var posy = 0;
if (!e) var e = window.event;
if (e.pageX || e.pageY) {
posx = e.pageX;
posy = e.pageY;
}
else if (e.clientX || e.clientY) {
posx = e.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
posy = e.clientY + document.body.scrollTop
+ document.documentElement.scrollTop;
}
alert ('x=' + posx + " y=" + posy);
document.write(posx + " " + posy) ;
// posx and posy contain the mouse position relative to the document
// Do something with this information
}
Leo
Profil
Problem je v document.write - nemuzete jim zapisovat do stranky, kdyz uz je natazena... Leo
peta
Profil
viz Leo
jakpsatweb - javascript - objekt window/document
document.write prepisuje cely dokument od tagu HTML

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0