»
EnglishFrenchVietnamese

Print - Star Mouse - JavaScriptBank.com

Full version: jsB@nk » Pointer » Trailer » Star Mouse
URL: https://www.javascriptbank.com/star-mouse.html

Star Mouse © JavaScriptBank.comThis cursor script produces dancing stars that animate and swirl around your mouse. The script uses NO images, so the effect is extremely lightweight and easy to customize.

Full version: jsB@nk » Pointer » Trailer » Star Mouse
URL: https://www.javascriptbank.com/star-mouse.html



JavaScript
<SCRIPT language=JavaScript><!--var ns=(document.layers)?1:0;var step=1;var cstep = 0;var a=0;var b=100;var Xpos=0;var Ypos=0;var n=7;var colours=new Array('ffffff','00ff00','aaaaff','ff00ff','ffa500','ff0000','fff000');(document.layers)?window.captureEvents(Event.MOUSEMOVE):0;function Mouse(evnt){ Ypos = (document.layers)?evnt.pageY:event.y; Xpos = (document.layers)?evnt.pageX:event.x;}(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;if (ns){for (i=0; i < n; i++)document.write('<LAYER NAME="nsstars'+i+'" TOP=-200 LEFT=0 BGCOLOR='+colours[i]+' CLIP="0,0,2,2"></LAYER>');}else{document.write('<div id="ie" style="position:absolute;top:0;left:0;"><div style="position:relative">');for (i=0; i < n; i++)document.write('<span id="iestars" style="position:absolute;top:0;left:0;width:2px;height:2px;background:'+colours[i]+';font-size:2px"></span>');document.write('</div></div>');}function MorphSpin(){var wdth=(document.layers)?window.innerWidth-100:document.body.clientWidth-100;var dot=(document.layers)?document.layers["nsstars"+0]:iestars[0].style;for (i = 0; i < n; i++){ dot.top=Ypos+a*Math.cos((cstep+i*4.5)/5); dot.left=Xpos+a*Math.sin((cstep+i*4.5)/5); }a+=1;cstep+=step;setTimeout('MorphSpin()',10);for (i = 0; i < n; i++){ var dots=(document.layers)?document.layers["nsstars"+i]:iestars[i].style; if (a >= 100){  a=100;  step=2.5;  dots.top=Ypos+a*Math.cos((cstep-100)*i/90);  dots.left=Xpos+a*Math.sin((cstep-100)*i/90); } if (cstep > 182){  step=0.5;  dots.top=Ypos+b*Math.cos(((cstep-182)+i*4.5)/5)*Math.cos((cstep-182)/5);  dots.left=Xpos+b*Math.sin(((cstep-182)+i*4.5)/5); }}if (cstep > 210) b-=10;if (b < -wdth){for (i = 0; i < n; i++){(document.layers)?document.layers["nsstars"+i].top=-200:iestars[i].style.top=-200;}cstep=0;step=1;a=0;b=100;}}MorphSpin();//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->