Webpage special effects-js text floating with the mouse pointer

Source: Internet
Author: User
Tip: you can modify some code before running

<STYLE>. Spanstyle {position: absolute; visibility: visible; top:-50px; font-size: 10pt; font-family: Verdana; font-weight: bold; color: # FF8080}</sTYLE></head><body onLoad="makesnake()" ><script language="JavaScript">Var x, yvar step = 20var flag = 0var message = "thank you for logging on to this site! "Message = message. split (" ") var xpos = new Array () var ypos = new Array () function handlerMM (e) {x = (document. layers )? E. pageX: document. body. scrollLeft + event. clientXy = (document. layers )? E. pageY: document. body. scrollTop + event. clientYflag = 1} function makesnake () {if (flag = 1 & document. all) {for (I = message. length-1; I> = 1; I --) {xpos [I] = xpos [i-1] + stepypos [I] = ypos [i-1]} xpos [0] = x + stepypos [0] = yfor (I = 0; I<message.length-1; i++) {var thisspan = eval("span"+(i)+".style")thisspan.posLeft=xpos[i]thisspan.posTop=ypos[i]}}var timer=setTimeout("makesnake()",30)}for (i=0;i<=message.length-1;i++) {document.write("")document.write(message[i])document.write("")}document.onmousemove = handlerMM;</script>Keywords: js text, mouse pointer floating
Tip: you can modify some code before running

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.