#!/COMMUNITY
Members: 5374
davon online: 1
weitere User: 28
12.02.2012 / 10:18
Community-Member werden
|
Paßwort vergessen
|
OnlineMonitor (1)
Perl-Archiv
Forum
Javascript
Home
PERLscripts
PHPscripts
JAVAscripts
Hilfreiches
Links2www
Newscenter
Community
Interna
Javascript
Archivübersicht
Tutorials
Zum Forum
JS-Links
BuchTipps
WebForen
Forenübersicht
Neueste Themen
Ohne Antwort
Aktivste Themen
Themensuche
Forenarchiv
Newsgroups
Javascript » DHTML » Maus-Wurm
zur Übersicht
Kategorie
DHTML
Bezeichnung
Maus-Wurm
ScriptDemo
Neues Fenster für Demo öffnen
Statistik
20385 Aufrufe davon 1x gestern
Keine Beschreibung vorhanden.
Javascript-Quellcode
(einfach markieren, kopieren und lokal abspeichern)
<script> /*********************** WURM-Skript Anfang *****************************/ /*** WWW.WerIstFelix.de *** Felix@Antifas.de ***/ var anzahl = 50; // Die Wirkung am besten einfach durch testen ausprobieren :-) var groesse = 15; // Ist so aber schon ziemlich optimiert auf Darstellung var abstand1 = 8; // Läuft auf meinem K6/2 500'er recht flüssig var radius = 15; //radius der dreienn... function erzeuge() //erzeugt die ausrichtbaren Grafiken { var a=1; var text=""; document.body.innerHTML += "<span id='AAA' class='wurm'></span>"; while(a<=anzahl) { text +="<span id='wurmX"+a+"' style='{position:absolute; top:"+(-groesse)+"px; left:"+(-groesse)+"px; margin:0;}' class='wurm"+a+"'></span>"; text +="<span id='wurma"+a+"' style='{position:absolute; top:"+(-groesse)+"px; left:"+(-groesse)+"px; background-color:#FF0000; margin:0; height: "+groesse+"px; width: "+groesse+"px; filter:Alpha(style=2, opacity=50, finishopacity=0);}' class='wurm"+a+"'></span>"; text +="<span id='wurmb"+a+"' style='{position:absolute; top:"+(-groesse)+"px; left:"+(-groesse)+"px; background-color:#00FF00; margin:0; height: "+groesse+"px; width: "+groesse+"px; filter:Alpha(style=2, opacity=50, finishopacity=0);}' class='wurm"+a+"'></span>"; text +="<span id='wurmc"+a+"' style='{position:absolute; top:"+(-groesse)+"px; left:"+(-groesse)+"px; background-color:#0000FF; margin:0; height: "+groesse+"px; width: "+groesse+"px; filter:Alpha(style=2, opacity=50, finishopacity=0);}' class='wurm"+a+"'></span>"; a++; } document.all["AAA"].innerHTML = text; laufen(); } document.onload = setTimeout("erzeuge()",500); var x=-groesse,y=-groesse; //linke obere Ecke außerhalb des Bildschirmes function erfasse() //erfasst die Mauskordinaten { x = window.event.x + document.body.scrollLeft - groesse/2; y = window.event.y + document.body.scrollTop - groesse/2; } document.onmousemove = erfasse; var X=0,Y=0,winkel=0; function neue_koordinaten(x1,y1) //richtet die letzte Grafik ganz nach vorne { X = abstand1 * Math.sin(Math.atan2(y-y1,x-x1)); Y = abstand1 * Math.sin(Math.atan2(x-x1,y-y1)); winkel = Math.atan2(x-x1,y-y1); status = Math.round(winkel/Math.PI/2*360) } var b=anzahl-1; var c=anzahl; var d=anzahl-Math.ceil(anzahl/32*23); var j=0; function laufen() // diese Funktion sorgt dafür, dass es kontinuierlich funktioniert { neue_koordinaten(document.all["wurmX"+d].style.pixelLeft,document.all["wurmX"+d].style.pixelTop); document.all["wurma"+b].style.pixelTop = document.all["wurmX"+c].style.pixelTop + X + Math.sin(j)*radius*Math.sin(winkel); document.all["wurmb"+b].style.pixelTop = document.all["wurmX"+c].style.pixelTop + X + Math.sin(j + Math.PI/3*2)*radius*Math.sin(winkel); document.all["wurmc"+b].style.pixelTop = document.all["wurmX"+c].style.pixelTop + X + Math.sin(j + Math.PI/3*4)*radius*Math.sin(winkel); document.all["wurmX"+b].style.pixelTop = document.all["wurmX"+c].style.pixelTop + X; neue_koordinaten(document.all["wurmX"+d].style.pixelLeft,document.all["wurmX"+d].style.pixelTop); document.all["wurma"+b].style.pixelLeft =document.all["wurmX"+c].style.pixelLeft + Y +Math.cos(j)*radius*Math.cos(winkel); document.all["wurmb"+b].style.pixelLeft =document.all["wurmX"+c].style.pixelLeft + Y +Math.cos(j + Math.PI/3*2)*radius*Math.cos(winkel); document.all["wurmc"+b].style.pixelLeft =document.all["wurmX"+c].style.pixelLeft + Y +Math.cos(j + Math.PI/3*4)*radius*Math.cos(winkel); document.all["wurmX"+b].style.pixelLeft =document.all["wurmX"+c].style.pixelLeft + Y; j+=0.4; b--; if(b<=0) b=anzahl; c--; if(c<=0) c=anzahl; d--; if(d<=0) d=anzahl; setTimeout("laufen()",10); } /*********************** WURM-Skript Ende *******************************/ </script>
Kommentare zu
Maus-Wurm
0 Kommentar(e) vorhanden / Anzeige der neuesten 5
Noch keine Kommentare zu diesem Javascript vorhanden.
Alle Kommentare anzeigen
-
Kommentar hinzufügen
© PERL/CGI/
PHP
/JS/SCRIPT/unity.de 1998-2009 .::.
interaktiv.shop
.::.
CGI-Service
.::.
Kontakt
.::.
Impressum
Link: /javascript/scripts/javascript_0323_main.shtml .::. Aufrufe heute: 2 .::. Aufrufe gesamt: 9735