画像がついてくるマウスストーカーのサンプル

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( '<span id="mouseMoving" style="position:absolute;visibility:visible;z-index:10;">', '<img src="http://external-file.com/ja/files/drink.gif" width="32" height="32">',//使用する画像のURL '<\/span>');

WEB BBS | サンプル一覧 | TOP |



 | Contact us at Feedback  | SitePolicy | 

Last Update: 11 / 30 / 2010 20:57:26 JST

 | 子連れ ヘラブナ釣り  | ひかる君の写真集  | Bayani  | Balita  | Bagong Bayani  | Directory  | herabuna.org  | Web BBS  | JS File |