[Beschreibung]
Sterne umkreisen den Mauszeiger.
[Kompatibilität]
[Code]
<script language="JavaScript"> <!-- Updated Stars Script by kurt.grigg@virgin.net /* Once again updated by N8i (www.nightfire.ch) * * Script works now with all DOM compliant browsers */ // ***** konfigurierbarer Bereich ***** // var images='IhreGrafik.gif'; //Der Name Ihres Bildes!! var amount=8; //Anzahl der zu erzeugenden Bilder!! // ***** Ende konfigurierbarer Bereich ***** // var yBase = 150; var xBase = 200; var step = .2; var currStep = 0; var Xpos = 5; var Ypos = 5; var i = 0; var j = 0; //Browser Sniffer var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? 1 : 0; var mozup = (!document.all && document.getElementById) ? 1 : 0; // Capturing MouseMove function handlerMM(e) { Xpos = (ns4up || mozup) ? e.pageX-5 : document.body.scrollLeft+event.clientX-5 Ypos = (ns4up || mozup) ? e.pageY-5 : document.body.scrollTop+event.clientY-5 } if (ns4up) { window.captureEvents(Event.MOUSEMOVE); window.onMouseMove = handlerMM; } if (ie4up || mozup) { window.document.onmousemove = handlerMM; } // Write objects if (ie4up) { document.write('<div id="ieDiv" style="position:absolute;top:0px;left:0px">') document.write('<div id="c" style="position:relative">'); for (n=0; n < amount; n++) { document.write('<img src=" '+images+'" style="position:absolute;top:0px;left:0px">') } document.write('</div>') document.write('</div>') } if (ns4up) { for (ns=0; ns < amount; ns++) { document.write("<LAYER NAME='n"+ns+"' LEFT=0 TOP=0><IMG SRC='"+images+"'></LAYER>"); } } if (mozup) { for (n=0; n < amount; n++) { document.write('<div id="c'+n+'" style="position:absolute;top:0px;left:0px"><img src=" '+images+'"></div>') } } function Swirl(){ if (ie4up) { yBase = window.document.body.offsetHeight/4; xBase = window.document.body.offsetWidth/4; } if (ns4up || mozup) { yBase = window.innerHeight/4; xBase = window.innerWidth/4; } if (ie4up) { for (i=0;i<ieDiv.all.c.all.length;i++) { ieDiv.all.c.all[i].style.top = Ypos + Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10); ieDiv.all.c.all[i].style.left = Xpos + Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10); } } if (ns4up) { for ( j = 0 ; j < ns ; j++ ){ var temp="n"+j document.layers[temp].top = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10); document.layers[temp].left = Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10); } } if (mozup) { for ( j = 0 ; j < amount ; j++ ){ var temp="c"+j document.getElementById(temp).style.top = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10); document.getElementById(temp).style.left = Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10); } } currStep += step; setTimeout("Swirl()", 10); } Swirl(); // --> </script>
Kurt Grigg modified by N8i (www.nightfire.ch)
Kopieren Sie bitte den Scriptcode