Text with the mouse

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

<html><head><script>var x,yvar step=40var flag=0var message="欢迎我的网站"message=message.split("")var xpos=new Array()for (i=0;i<=message.length;i++) {xpos[i]=-50}var ypos=new Array()for (i=0;i<=message.length;i++) {ypos[i]=-50}function handlerMM(e){x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientXy = (document.layers) ? e.pageY : document.body.scrollTop+event.clientYflag=1}function makeit() {if (flag==1 && document.all) { for (i=message.length; i>=1; i--) { xpos[i]=xpos[i-1]+stepypos[i]=ypos[i-1] }xpos[0]=x+stepypos[0]=yfor (i=0; i<message.length; 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; i>=1; i--) { xpos[i]=xpos[i-1]+stepypos[i]=ypos[i-1] }xpos[0]=x+stepypos[0]=yfor (i=0; i<message.length; i++) { var thisspan = eval("document.span"+i) thisspan.left=xpos[i]thisspan.top=ypos[i]}}var timer=setTimeout("makeit()",30)}for (i=0;i<=message.length;i++) { document.write("")document.write(message[i]) document.write("")}if (document.layers){document.captureEvents(Event.MOUSEMOVE);}document.onmousemove = handlerMM;</script><title>Text with the mouse</title><style type="text/css">. Spanstyle {position: absolute; visibility: visible; top:-50px; font-size: 9pt; color: # c800c0; font-weight: bold ;}</style></head><body onLoad="makeit()"></body></html>
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.