10个经典的网页鼠标特效代码(4)
4、鼠标经过滚动提示文字
<a href="http://www.网址.com" rel="external nofollow" _fcksavedurl="http://www.网址.com" target="_blank" onMouseOver="helpor_net_show(this,event,'网页鼠标特效')" onMouseOut="helpor_net_hide()">把鼠标放上来试试</a> <div id="tooltip2" style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:seashell"> <layer name="nstip" width="1000px" bgColor="seashell"></layer> </div> <SCRIPT language="JavaScript"> <!-- if (!document.layers&&!document.all) event="test" function helpor_net_show(current,e,text){ if (document.all&&document.readyState=="complete"){ document.all.tooltip2.innerHTML='<marquee style="border:1px solid #3399ff">'+text+'</marquee>' document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10 document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10 document.all.tooltip2.style.visibility="visible" } else if (document.layers){ document.tooltip2.document.nstip.document.write('<b>'+text+'</b>') document.tooltip2.document.nstip.document.close() document.tooltip2.document.nstip.left=0 currentscroll=setInterval("scrolltip()",100) document.tooltip2.left=e.pageX+10 document.tooltip2.top=e.pageY+10 document.tooltip2.visibility="show" } } function helpor_net_hide(){ if (document.all) document.all.tooltip2.style.visibility="hidden" else if (document.layers){ clearInterval(currentscroll) document.tooltip2.visibility="hidden" } } function scrolltip(){ if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width) document.tooltip2.document.nstip.left-=5 else document.tooltip2.document.nstip.left=150 } //--> </SCRIPT>
5、围绕鼠标旋转的三叶空间旋浆
<html> <head> <title>围绕鼠标旋转的三叶空间旋浆</title> <meta content="text/html; charset=gb2312" http-equiv="Content-Type"> </head> <body bgColor="#000000"> <script language="JavaScript"> <!-- //To add more stars simply add more colours in below array!! colours=new Array('ff0000','00ff00','3366ff','ff00ff','ffa500','ffffff','fff000') //Alter nothing below!! amount=colours.length; YgetDelay=0,XgetDelay=0,Ydelay=0,Xdelay=0,ns=(document.layers)?1:0,step=0.2,currStep=0,my=0,mx=0; if (ns){ for (i=0; i < amount; i++) document.write('<LAYER NAME="nsstars'+i+'" BGCOLOR='+colours[i]+' CLIP="0,0,2,2"></LAYER>'); } else{ document.write('<div id="ie" style="position:absolute;top:0;left:0;"><div style="position:relative">'); for (i=0; i < amount; i++) document.write('<span id="iestars" style="position:absolute;top:0;left:0;width:2px;height:2px;background:'+colours[i]+';font-size:2px"></span>'); document.write('</div></div>'); } if (ns){ window.captureEvents(Event.MOUSEMOVE); function nMouse(evnt){ my=evnt.pageY;mx=evnt.pageX } window.onMouseMove=nMouse; } else{ function iMouse(){ my=event.y;mx=event.x; } document.onmousemove=iMouse } function stars(){ if (!ns)ie.style.top=document.body.scrollTop; for (i=0; i < amount; i++) { var layer=(document.layers)?document.layers["nsstars"+i]:iestars[i].style; layer.top= Ydelay+100*Math.sin((5*Math.sin((currStep-15.99)/10))+i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10); layer.left=Xdelay+180*Math.cos((5*Math.sin((currStep-15.99)/10))+i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10); } currStep+=step; } function delay(){ Ydelay = YgetDelay+=(my-YgetDelay)*1/20; Xdelay = XgetDelay+=(mx-XgetDelay)*1/20; stars(); setTimeout('delay()',10); } delay(); //--> </script> <script language="JavaScript"> <!-- hide function goHist(a) { history.go(a); } //--> </script> </body> </html>
内容版权声明:除非注明,否则皆为本站原创文章。