One of the many [URL="http://www.javascript****.com/javascript/very nice mouse/"]cursor[/URL] codes in our JavaScript library, this one creates dancing stars animating around your pointers mouse. This [URL="http://www.javascript****.com/=cursor move"]cur... [URL="http://www.javascript****.com/dancing-animation-stars-cursor.html/en//"]detail[/URL] at [URL="http://www.javascript****.com/"]JavaScript****.com - 2.000+ free JavaScript codes[/URL]
[URL="http://www.javascript****.com/javascript/mouse/trailer/dancing-animation-stars-cursor/preview/en/"][IMG]http://www.javascript****.com/javascript.images/mouse/dancing-animation-stars-cursor.jpg[/IMG][/URL]
Demo: [URL="http://www.javascript****.com/dancing-animation-stars-cursor.html/en/"]JavaScript Dancing Animation Stars Cursor[/URL]
How to setup
Step *: Place JavaScript below in your HEAD section
JavaScript
Code:
<script language="JavaScript">
<!--
/*
Dancing Stars cursor (Submitted by Kurt at kurt.grigg@virgin.net)
Modified and permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and *00's more DHTML scripts, visit http://dynamicdrive.com
*/
if (document.all){
document.write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')
for (xy=0;xy<7;xy++)
document.write('<div style="position:relative;width:*px;height:*px;background:#FFFF00;font-size:2px;visibility:visible"></div>')
document.write('</div>')
}
if (document.layers)
{window.captureEvents(Event.MOUSEMOVE);}
var yBase = 200;
var xBase = 200;
var yAmpl = *0;
var yMax = 40;
var step = .2;
var ystep = .5;
var currStep = 0;
var tAmpl=*;
var Xpos = *;
var Ypos = *;
var i = 0;
var j = 0;
if (document.all)
{
function MoveHandler(){
Xpos = document.body.scrollLeft+event.x;
Ypos = document.body.scrollTop+event.y;
}
document.onmousemove = MoveHandler;
}
else if (document.layers)
{
function xMoveHandler(evnt){
Xpos = evnt.pageX;
Ypos = evnt.pageY;
}
window.onMouseMove = xMoveHandler;
}
function animateLogo() {
if (document.all)
{
yBase = window.document.body.offsetHeight/4;
xBase = window.document.body.offsetWidth/4;
}
else if (document.layers)
{
yBase = window.innerHeight/4 ;
xBase = window.innerWidth/4;
}
if (document.all)
{
var totaldivs=document.all.starsDiv.all.length
for ( i = 0 ; i < totaldivs ; i++ )
{
var tempdiv=document.all.starsDiv.all[i].style
tempdiv.top = Ypos + Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(*0+currStep/*0)+0.2)*Math.cos((currStep + i*25)/*0);
tempdiv.left = Xpos + Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(*0+currStep/*0)+0.2)*Math.cos((currStep + i*25)/*0);
}
}
else if (document.layers)
{
for ( j = 0 ; j < 7 ; j++ )
{
var templayer="a"+j
document.layers[templayer].top = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(*0+currStep/*0)+0.2)*Math.cos((currStep + j*25)/*0);
document.layers[templayer].left =Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(*0+currStep/*0)+0.2)*Math.cos((currStep + j*25)/*0);
}
}
currStep += step;
setTimeout("animateLogo()", *5);
}
animateLogo();
// -->
</script>
Step 2: Copy & Paste HTML code below in your BODY section
HTML
Code:
<LAYER NAME="a0" LEFT=*0 TOP=*0 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,*,*"></LAYER>
<LAYER NAME="a*" LEFT=*0 TOP=*0 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,*,*"></LAYER>
<LAYER NAME="a2" LEFT=*0 TOP=*0 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,*,*"></LAYER>
<LAYER NAME="a*" LEFT=*0 TOP=*0 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,*,*"></LAYER>
<LAYER NAME="a4" LEFT=*0 TOP=*0 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,*,*"></LAYER>
<LAYER NAME="a5" LEFT=*0 TOP=*0 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,*,*"></LAYER>
<LAYER NAME="a6" LEFT=*0 TOP=*0 VISIBILITY=SHOW BGCOLOR="#FFFF00" CLIP="0,0,*,*"></LAYER>
[URL="http://www.javascript****.com/web-based-music-player.html/en/"]Javascript Music Player[/URL] - [URL="http://www.javascript****.com/random-text-generator.html"]Random Text Generator[/URL] - [URL="http://www.javascript****.com/up-down-floating-image.html"]Floating Image Script[/URL]