<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<META http-equiv="Content-Style-Type" content="text/css">
<title>マウスを追いかける画像</title>
<script language="JavaScript">
<!--
var move_x = 10; //マウスから離れている横方向の距離
var move_y = 10; //マウスから離れている縦方向の距離
function mousemoving(mouseevent){
if (document.all){
document.all('mouseimg').style.left= event.x + move_x;
document.all('mouseimg').style.top = event.y + move_y;
return;
}
if (document.layers){
document.layers['mouseimg'].left = mouseevent.x + move_x;
document.layers['mouseimg'].top = mouseevent.y + move_y;
}
if( navigator.userAgent.indexOf("Gecko",0) != -1){
if (document.getElementById){
document.getElementById('mouseimg').style.left= mouseevent.pageX + move_x;
document.getElementById('mouseimg').style.top = mouseevent.pageY + move_y;
}
}
}
if (document.all){
document.onmousemove = mousemoving;
}
else {
if (document.layers || document.getElementById ) {
window.captureEvents(Event.MOUSEMOVE);
onmousemove = mousemoving;
}
}
//-->
</script>
<style type="text/css">
<!--
.typ1 { position:absolute;
top:0px;
left:0px;}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<div id="mouseimg" class="typ1"><img src="1.gif"></div>
</body>
</html>