画像がついてくるマウスストーカーのサンプル
IEのみ可。 IE以外のブラウザでは、機能しません。
Point = 50; //マウスから画像の距離設定
Tunay = 45; //停止時のマウスからの角度設定 0なら右 90なら下 180なら左 270なら上
Ikot = 0; //0は回転停止 数値上げると画像が回転し速度が上がっていきます。
NN = navigator.appName.charAt(0);
mouse1 = 0;
mouse2 = 0;
function Moving(){
if (NN="M") {
mouse1 = event.clientX;
mouse2 = event.clientY;
mouse1 = mouse1+document.body.scrollLeft;
mouse2 = mouse2+document.body.scrollTop;
}
}
function Kiros(){
if(NN=="M") {
Tunay = Tunay + Ikot;
if (Tunay >= 360) {
Tunay = Tunay-360;
}
x = Math.cos(Tunay*3.14/180)*Point;
y = Math.sin(Tunay*3.14/180)*Point;
mouseMoving.style.posLeft = mouse1+x;
mouseMoving.style.posTop = mouse2+y;
}
}
if(NN=="M") {
document.onmousemove = Moving;
Kirosid = setInterval('Kiros()',30);
}
document.write(
'',
'
',//使用する画像のURL
'<\/span>');
Copyright(C)2008 bisoy , All rights reserved.
Last Update: 6 / 25 / 2008 18:04:28 JST