03/12/13 01:18
<script type="text/javascript">
var radian = 0;
var r = 50;
var x = 0;
var y = 0;
function setPos(a){
if(document.all){
x = event.x;
y = event.y;
return;
}
x = a.pageX;
y = a.pageY;
}
function moveChara(){
document.getElementById("cursor").style.left = r * Math.sin(radian) + x;
document.getElementById("cursor").style.top = r * Math.cos(radian) + y;
radian += Math.PI / 180 * 5;
}
document.onmousemove = setPos;
setInterval("moveChara()",1);
</script>
body内に以下の記述をしてください。
<div id="cursor" style="position:absolute; visibility:visible;">
<span style="position:relative;left:-50%;top:-50%;">ヽ(`Д´)ノ </span>
</div>
変数rで回転半径を設定できます。
IE,Mozilla,Operaで動作確認。