»
EnglishFrenchVietnamese

Print - Waving Text Trailer - JavaScriptBank.com

Full version: jsB@nk » Pointer » Trailer » Waving Text Trailer
URL: http://www.javascriptbank.com/waving-text-trailer.html

Waving Text Trailer © JavaScriptBank.comThis JavaScript codecan be used to be that a mouse cursor pointer was just a mouse cursor. Since DHTML came along and gave programmers the ability to track the precise coordinates of the mouse, it was only a matter of time that cursor effects started showing up. This is Peter's great cursor text effect. It's pretty self explanatory, not to mention awesome!

Full version: jsB@nk » Pointer » Trailer » Waving Text Trailer
URL: http://www.javascriptbank.com/waving-text-trailer.html



CSS
<STYLE>.spanstyle {FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; POSITION: absolute; TOP: -50px}</STYLE>


JavaScript
<SCRIPT>/*Cursor Trailor Text- By Peter Gehrig (http://www.24fun.ch/)Permission given to Dynamicdrive.com to feature script in it's archive.*/var moves=17var tracker=0var xposvar yposvar cursortext='JavaScriptBank.com - Bank of over 2000+ free JavaScript'cursortext=cursortext.split("")function setup() {if (tracker==1 && document.all) {    for (i=cursortext.length-1; i>=1; i--) {   xposition[i]=xposition[i-1]+movesyposition[i]=yposition[i-1]    }xposition[0]=xpos+movesyposition[0]=yposfor (i=0; i<cursortext.length-1; i++) {    var thisspan = eval("span"+(i)+".style")    thisspan.posLeft=xposition[i]thisspan.posTop=yposition[i]    }}else if (tracker==1 && document.layers) {    for (i=cursortext.length-1; i>=1; i--) {   xposition[i]=xposition[i-1]+movesyposition[i]=yposition[i-1]    }xposition[0]=xpos+movesyposition[0]=yposfor (i=0; i<cursortext.length-1; i++) {    var thisspan = eval("document.span"+i)    thisspan.left=xposition[i]thisspan.top=yposition[i]    }}var timer=setTimeout("setup()",40)}function MouseMovement(e){xpos = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientXypos = (document.layers) ? e.pageY : document.body.scrollTop+event.clientYtracker=1}var xposition=new Array()for (i=0;i<=cursortext.length-1;i++) {xposition[i]=-50}var yposition=new Array()for (i=0;i<=cursortext.length-1;i++) {yposition[i]=-50}/*hieu ung di chuyen chuot*/for (i=0;i<=cursortext.length-1;i++) {    document.write("<span id='span"+i+"' class='spanstyle'>")document.write(cursortext[i])    document.write("</span>")}if (document.layers){document.captureEvents(Event.MOUSEMOVE);}document.onmousemove = MouseMovement;</SCRIPT>


HTML
<BODY onload=setup()></body>