<script language="JavaScript"> <!-- var mouse=new Object() mouse.msg="欢迎光临安安的梦幻家园" mouse.x=0 mouse.y=0 mouse.speed=Math.PI/180 // 1 degree mouse.radius=50 mouse.ms=new Array() if(document.layers){ document.captureEvents(Event.MOUSEMOVE) for(i=0;i<=mouse.msg.length;i++)document.write("<layer name='mousetext"+i+"'>"+mouse.msg.charAt(i)+"</layer>") }else for(i=0;i<=mouse.msg.length;i++)document.write("<span id='mousetext"+i+"' class='tacoscript'>"+mouse.msg.charAt(i)+"</span>") for(i=0;i<=mouse.msg.length;i++){ mouse.ms[i]=document.getElementById?document.getElementById("mousetext"+i).style:document.all?document.all["mousetext"+i].style:document.layers["mousetext"+i] mouse.ms[i].deg=Math.PI*2/mouse.msg.length*i} document.function m(e){ if(!e)e=event mouse.x=document.all?document.body.scrollLeft+e.clientX:e.pageX mouse.y=document.all?document.body.scrollTop+e.clientY:e.pageY run()} function run(){ for(i=mouse.ms.length-1;i>=0;i--){ mouse.ms[i].deg+=mouse.speed mouse.ms[i].left=mouse.x-Math.sin(mouse.ms[i].deg)*mouse.radius mouse.ms[i].top=mouse.y+Math.cos(mouse.ms[i].deg)*mouse.radius}} setInterval(run,100) //--> </script> <style type="text/css"> <!-- .tacoscript {font-size:10pt;POSITION: absolute;VISIBILITY: visible} --> </style>
精制的鼠标时钟
闪烁的星星
跟随鼠标的图片
<script LANGUAGE="JavaScript"> var newtop=0; var newleft=0; if (navigator.appName == "Netscape") {; layerStyleRef="layer."; layerRef="document.layers"; styleSwitch=""; }; else; {; layerStyleRef="layer.style."; layerRef="document.all"; styleSwitch=".style"; }; function doMouseMove() {; layerName = 'iit'; eval('var curElement='+layerRef+'["'+layerName+'"]') eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"'); eval('curElement'+styleSwitch+'.visibility="visible"') eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth') eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight') eval('height=curElement'+styleSwitch+'.height') eval('width=curElement'+styleSwitch+'.width') width=parseInt(width) height=parseInt(height) if (event.clientX > (document.body.clientWidth - 5 - width)) { newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width } else { newleft=document.body.scrollLeft + event.clientX } eval('curElement'+styleSwitch+'.pixelLeft=newleft') if (event.clientY > (document.body.clientHeight - 5 - height)) { newtop=document.body.clientHeight + document.body.scrollTop - 5 - height } else { newtop=document.body.scrollTop + event.clientY } eval('curElement'+styleSwitch+'.pixelTop=newtop') } document. doMouseMove; </script> <script language="javascript"> if (navigator.appName == "Netscape") { } else { document.write('<div ID=OuterDiv>') //将下面的SRC后的图片地址改为你的图片地址 document.write('<img ID=iit src="191.gif" STYLE="position:absolute;TOP:5pt;LEFT:5pt;Z-INDEX:10;visibility:hidden;">') document.write('</div>') } </script>
跟随滚动文字
<SCRIPT language="JavaScript1.2"> <!-- /* Cursor scroller script- By Dynamicdrive.com */ //1) set message to display var scroller_msg='Welcome to 欢迎光临安安的梦幻家园 //2) set whether message should auto disappear after x seconds (0=perpetual). //Note that double clicking page will also dismiss message var dismissafter=0 var initialvisible=0 if (document.all) document.write('<marquee id="curscroll" style="position:absolute;width:150px;border:1px solid black;font-size:14px;background-color:white;visibility:hidden">'+scroller_msg+'</marquee>') function followcursor(){ //move cursor function for IE if (initialvisible==0){ curscroll.style.visibility="visible" initialvisible=1 } curscroll.style.left=document.body.scrollLeft+event.clientX+10 curscroll.style.top=document.body.scrollTop+event.clientY+10 } function dismissmessage(){ curscroll.style.visibility="hidden" } if (document.all){ document.followcursor document.dismissmessage if (dismissafter!=0) setTimeout("dismissmessage()",dismissafter*1000) } //--> </SCRIPT>