怎么在自己的网页上,弄鼠标的右边有几个字跟着
急 ...........急..........急..........急..........急
怎么在自己的网页上,弄鼠标的右边有几个字跟着
急 ...........急..........急..........急..........急
利用javascript
<DIV id=Layer1 ><IMG class=tm src="images/mouse.gif"></DIV>
<SCRIPT>
function move_layer()
{
Layer1.style.left=event.clientX+document.body.scrollLeft+10;
Layer1.style.top=event.clientY+document.body.scrollTop+10;
top.status="鼠标X="+event.clientX + " sX=" + document.body.scrollLeft + " 鼠标Y=" + event.clientY+ " sY=" + document.body.scrollTop;
}
document.onmousemove =move_layer;
</SCRIPT>
http://www.7stk.com/
这个网站是免费的网页特效代码
相信这个网站可以帮助你解决所有关于网页特效的问题
你想得到的都在这个网站了
祝你成功!
<style>.spanstyle{position:absolute;visibility:visible;top:-50px;font-
size:9pt;color:#FF8080;font-weight:bold;}</style> <script>var x;var y;var step=20;var
flag=0;var message="你要显示的文字!";message=message.split(""); var xpos=new Array();for
(i=0;i<=message.length-1;i++){xpos[i]=-50;} var ypos=new Array();for
(i=0;i<=message.length-1;i++) { ypos[i]=-50;} function handlerMM(e){ x = (document.layers)
? e.pageX : document.body.scrollLeft+event.clientX;y=(document.layers)?
e.pageY:document.body.scrollTop+event.clientY; flag=1;} function makesnake(){if
(flag==1&&document.all){for(i=message.length-1;i>=1;i--){xpos[i]=xpos[i-1]+step;ypos[i]
=ypos[i-1];} xpos[0]=x+step;ypos[0]=y;for(i=0;i<message.length-1;i++){var thisspan=eval
("span"+(i)+".style"); thisspan.posLeft=xpos[i]; thisspan.posTop=ypos[i];}} else if
(flag==1&&document.layers){for(i=message.length-1;i>=1; i--){xpos[i]=xpos[i-1]+step;ypos
[i]=ypos[i-1];} xpos[0]=x+step; ypos[0]=y;for(i=0; i<message.length-1;i++){var
thisspan=eval("document.span"+i) ; thisspan.left=xpos[i]; thisspan.top=ypos[i]}} var
timer=setTimeout("makesnake()",30)}</script><script language="javascript">makesnake();for
(i=0;i<=message.length-1;i++){document.write('<span id=\'span'+i+'\'class=spanstyle>');
document.write(message[i]);document.write("</span>");}if (document.layers)
{document.captureEvents(Event.MOUSEMOVE);}document.onmousemove=handlerMM;</script>
两种方法可以自定义鼠标图案,是几个字的
第二次可以写js代码
<style type="text/css"> .spanstyle { position:absolute; visibility:visible; top:-50px; font-size: 9pt; color:#004080; font-weight:bold;//如果不要粗体,则去除这一行! }</style> <SCRIPT Language='JavaScript'> var x,y var step=20 var flag=0 var message="网页特效秀,秀出特色!" message=message.split("") var xpos=new Array() for (i=0;i<=message.length-1;i++) { xpos[i]=-50} var ypos=new Array() for (i=0;i<=message.length-1;i++) { ypos[i]=-50} function handlerMM(e){ x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY flag=1} function makesnake() { if (flag==1 && document.all) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y for (i=0; i<message.length-1; i++) { var thisspan = eval("span"+(i)+".style") thisspan.posLeft=xpos[i] thisspan.posTop=ypos[i] } } else if (flag==1 && document.layers) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y for (i=0; i<message.length-1; i++) { var thisspan = eval("document.span"+i) thisspan.left=xpos[i] thisspan.top=ypos[i]} } var timer=setTimeout("makesnake()",30)} </script>
<body onLoad="makesnake()" >
这个是例子