1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
<html>
<head>
<title></title>
<style type="text/css">
<!--
img{padding: 0px; margin: 50px}
//-->
</style>
<script type="text/javascript">
<!--
function position(obj,ev)
{
var Xfen, Xdoc, Yfen, Ydoc, el;
Xfen = ev.clientX;
Xdoc = Xfen + document.body.scrollLeft - obj.offsetLeft;
Yfen = ev.clientY;
Ydoc = Yfen + document.body.scrollTop - obj.offsetTop;
el = document.getElementById("posSouris");
el.innerHTML = " Ximg= "+Xdoc+" px ; Yimg= "+Ydoc+" px<br>";
el.innerHTML+= " Xfen= "+Xfen+" px ; Yfen= "+Yfen+" px";
}
//-->
</script>
</head>
<body>
<br><br>
<img src="tests/images/clair19.jpg" onmousemove="position(this,event)">
<br><br>
<div id="posSouris">
</div>
</body>
</html> |