Hallo, ich habe einen Code von einer Javascript-Seite gedownloadet und ich glaube der funktioniert nicht... Eigentlich sollen die Buchstaben wild durcheinander fliegen.. bei mir werden sie jedoch nur verteilt angezeigt, so dass sie sich nicht bewegen..
Ist an dem Code etwas falsch?!
ZitatAlles anzeigen
<html>
<head>
<script language="javascript">
function setVariables(){
if (navigator.appName == "Netscape") h=".left=", v=".top=",dS="document.",sD="";
else h=".pixelLeft=",v=".pixelTop=",dS="",sD=".style";}
var y = 200;
var x = 300;
var inc=0;
var X = 250;
var Y = 150;
function moveLetters() {
for ( j = 0 ; j <26 ; j++ ) {
objectX="object"+j
eval(dS + objectX +sD + v + (Y + Math.cos((20*Math.sin(inc/20))+j*70)*y*(Math.sin(10+inc/10)+0.2)*Math.cos((inc + j*25)/10)));
eval(dS + objectX + sD + h + (X + Math.sin((20*Math.sin(inc/20))+j*70)*x*(Math.sin(10+inc/10)+0.2)*Math.cos((inc + j*25)/10)));
}
inc+=.2;
setTimeout("moveLetters()", 1);
}
</script>
</head><body bgcolor="#ffffff" vlink="#0000ff" onload="setVariables(),moveLetters()";>
<div id="object0" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font color="#FF0000" size=+4>H</font></div>
<div id="object1" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font color="#0FFF00" size=+4>u</font></div>
<div id="object2" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font size=+4 color="#FF00FF">f</font></div>
<div id="object3" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font size=+4 color="#0080FF">s</font></div>
<div id="object4" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font size=+4 color="#FF8000">c</font></div>
<div id="object5" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font size=+4 color="#008000">h</font></div>
<div id="object6" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font size=+4 color="#8000FF">m</font></div>
<div id="object7" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font color="#FF0000" size=+4>i</font></div>
<div id="object8" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font color="#0FFF00" size=+4>e</font></div>
<div id="object9" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
<font size=+4 color="#FF00FF">d</font></div>
<div id="object10" style="position:absolute; visibility:show; left:250px; top:150px; z-index:2">
</body></html>