Follow the color text behind the mouse-code

Source: Internet
Author: User
Keywords Text color

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

<style>.spanstyle{color: #0066ff; Font-family: Song body; font-size:9pt; Font-weight:normal; Position:absolute; top:-50px; Visibility:visible}</style>


<script><script>var message= "The words you want to write"; var x,y;var step=12;var flag=0;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+10;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];thisspan.color=math.random ()  * 255  * 255 * 255 + math.random ()  * 255 * 255 +  Math.random ()  * 255;}}; 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];thisspan.color=math.random ()  * 255 * 255  * 255 + math.random ()  * 255 * 255 + math.random ()  *  255}} </SCRIPT>


<script>for (i=0;i<=message.length-1;i++) {document.write ("<span id= ' span" +i+ "' class= ' Spanstyle ') > ");d ocument.write (Message[i]);d ocument.write (" </span> "); if (document.layers) {document.captureevents (event.mousemove);}; Document.onmousemove = handlermm;</script>


<script>function pageonload () {makesnake (); Window.settimeout ("Pageonload ();", 2);} </SCRIPT>


<script>pageonload () </SCRIPT>


in the top section of the code you can define the font size, font. Then replace the text with what you want to use.


the above code directly into the previous module you have built inside the ~~~~~


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.