Witam, jak można sprawdzić pozycję kursora myszy za pomocą JavaScriptu?
Dziękuję, Babcia@Stefa
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <!-- Copyright Š 2008 nexis.pl --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script type="text/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.getElementById("x").value = tempX; document.getElementById("y").value = tempY; return true; } </script> </head> <body> <div> <input type="text" id="x" /> <input type="text" id="y" /> </div> </body> </html>