0
テーブルの左上にポイント0:0が必要です。位置が正しく動作しない
次にマウスをトップページから
<h2>
TestPosition</h2>
<table cellpadding="0" id="target" cellspacing="0" width="602" height="500" style="float: left;
margin: 0px; padding: 0px; position: relative; background: url(/content/games/kamikaze2/back.jpg) no-repeat 0 0;">
</table>
<div id="log">
</div>
<script type="text/javascript">
$("#target").mousemove(function (event) {
var thisPosX = $(this).position().left;
var thisPosY = $(this).position().top;
var relX = (event.clientX - thisPosX);
var relY = (event.clientY - thisPosY);
var msg = "Handler for .mousemove() called at ";
msg += relX + ", " + relY;
$("#log").html("<div>" + msg + "</div>");
});
</script>