<html xmlns="http://www./1999/xhtml">
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>凱詩非凡主角</title> <style type="text/css"> * { -moz-user-select:none; border:0px; } #tips { width:850px; padding-top:8px; padding-bottom:8px; background:#999999; color:#FFFFFF; text-align:center; margin:auto; font-size:14px; } </style> <script type="text/javas var Is_Mouse_Down = false var Is_First=1 function Create(evt){ evt=evt?evt:window.event if(Is_Mouse_Down){ if(evt.ctrlKey){ Clean(evt) } else { Write(evt) } } } function Write(evt){ evt=evt?evt:window.event var Obj_Nian=document.createElement("DIV") Obj_Nian.style.position="absolute" Obj_Nian.style.left=evt.clientX-10+"px" Obj_Nian.style.top=evt.clientY-10+"px" switch(Is_First){ case 1:Obj_Nian.innerHTML="留";break; case 2:Obj_Nian.innerHTML="念";break; case 3:Obj_Nian.innerHTML="我";break; case 4:Obj_Nian.innerHTML="喜";break; case 5:Obj_Nian.innerHTML="歡";break; case 6:Obj_Nian.innerHTML="你";break; default:Obj_Nian.innerHTML="kaishi";break; } Is_First+=1 if(Is_First==7){ Is_First=1 } Color_Nian="RGB("+Math.floor(Math.random()*100)+"%,"+Math.floor(Math.random()*100)+"%,"+Math.floor(Math.random()*100)+"%)" Obj_Nian.style.color=Color_Nian document.body.appendChild(Obj_Nian) } function Clean(evt){ evt=evt?evt:window.event evt.srcObj=evt.srcElement?evt.srcElement:evt.target if(evt.srcObj.tagName=="DIV" && (evt.srcObj.innerHTML=="留" || evt.srcObj.innerHTML=="念" || evt.srcObj.innerHTML=="我" || evt.srcObj.innerHTML=="喜" || evt.srcObj.innerHTML=="歡" || evt.srcObj.innerHTML=="你")){ evt.srcObj.innerHTML="" } } document.on document.on document.on </script> </head> <body on <div id="tips">提示:按住鼠標左鍵不放,在頁面中拖動即可寫字 ; 同時按住ctrl和鼠標左鍵不放,在頁面中拖動即可把字擦去</div> </body> </html> |
|