Samuel
Erfahrenes Mitglied
Ich habe hier ein Script geschrieben das eigentlich funktionieren sollte 3-)
ich find den Fehler nicht, vielleicht ihr. (i hope so)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
function menue(DivName) {
var ref;
var timer;
var divHeight;
if (document.all) {
switch (DivName) {
case "blub":
clearTimeout(timer);
document.all['blub'].style.visibility='visible';
document.all['blab'].style.clip="rect(0px, 0px, 0px, 0px)";
document.all['blob'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blub');
break;
case "blab":
clearTimeout(timer);
document.all['blab'].style.visibility='visible';
document.all['blub'].style.clip="rect(0px, 0px, 0px, 0px)";
document.all['blob'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blab');
break;
case "blob":
clearTimeout(timer);
document.all['blob'].style.visibility='visible';
document.all['blub'].style.clip="rect(0px, 0px, 0px, 0px)";
document.all['blab'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blob');
break;
}} else if ((!document.all) && (document.getElementById)) {
switch (DivName) {
case "blub":
clearTimeout(timer);
ref=document.getElementById('blub');
ref.style.visibility='visible';
ref=document.getElementById('blab');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
ref=document.getElementById('blob');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blub');
break;
case "blab":
clearTimeout(timer);
ref=document.getElementById('blab');
ref.style.visibility='visible';
ref=document.getElementById('blub');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
ref=document.getElementById('blob');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blab');
break;
case "blob":
clearTimeout(timer);
ref=document.getElementById('blob');
ref.style.visibility='visible';
ref=document.getElementById('blub');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
ref=document.getElementById('blab');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blob');
break;
}} else if (document.layers) {
switch (DivName) {
case "blub":
clearTimeout(timer);
document.layers['blub'].style.visibility='visible';
document.layers['blab'].style.clip="rect(0px, 0px, 0px, 0px)";
document.layers['blob'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blub');
break;
case "blab":
clearTimeout(timer);
document.layers['blab'].style.visibility='visible';
document.layers['blub'].style.clip="rect(0px, 0px, 0px, 0px)";
document.layers['blob'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blab');
break;
case "blob":
clearTimeout(timer);
document.layers['blob'].style.visibility='visible';
document.layers['blub'].style.clip="rect(0px, 0px, 0px, 0px)";
document.layers['blab'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blob');
break;
}}
}
function startAnimation(DivName) {
var divHeight;
if (document.all) {
if (divHeight<101) {
document.all[DivName].style.clip="rect(0px, auto, "+divHeight+"px, 0px)";
divHeight++;
timer=setTimeout("startAnimation('"+DivName+"')", 100);
}
} else if ((!document.all) && (document.getElementById)) {
if (divHeight<101) {
ref=document.getElementById(DivName);
ref.style.clip="rect(0px, 0px, "+divHeigt+"px, 0px)";
divHeight++;
timer=setTimeout("startAnimation('"+DivName+"')", 100);
}
} else if (document.layers) {
if (divHeight<101) {
document.layers[DivName].style.clip="rect(0px, 0px, "+divHeight+"px, 0px)";
divHeight++;
timer=setTimeout("startAnimation('"+DivName+"')", 100);
}
}}
</script>
</head>
<body>
<table cellpadding=0 cellspacing=0 border=1 width=300>
<tr>
<th width=100><a href="#" onclick="menue('blub')">Menue01</a></th>
<th width=100><a href="#" onclick="menue('blab')">Menue02</a></th>
<th width=100><a href="#" onclick="menue('blob')">Menue03</a></th>
</tr>
</table>
<div id="blub" align="center" style="clip:rect(0,0,0,0); position:absolute; visibility:visible; height:100px; width=100px; top:40px; left:10px; background-color:#CCCCCC;">
Menue01.1<br>Menue01.2<br>Menue01.3
</div>
<div id="blab" align="center" style="clip:rect(0,0,0,0); position:absolute; visibility:visible; height:100px; width=100px; top:40px; left:110px; background-color:#004080;">
Menue02.1<br>Menue02.2<br>Menue02.3
</div>
<div id="blob" align="center" style="clip:rect(0,0,0,0); position:absolute; visibility:visible; height:100px; width=100px; top:40px; left:210px; background-color:#00ff00;">
Menue03.1<br>Menue03.2<br>Menue03.3
</div>
</body>
</html>
ich hoffe ihr findet diesen blöden fehler
greetings [23]^5^
ich find den Fehler nicht, vielleicht ihr. (i hope so)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
function menue(DivName) {
var ref;
var timer;
var divHeight;
if (document.all) {
switch (DivName) {
case "blub":
clearTimeout(timer);
document.all['blub'].style.visibility='visible';
document.all['blab'].style.clip="rect(0px, 0px, 0px, 0px)";
document.all['blob'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blub');
break;
case "blab":
clearTimeout(timer);
document.all['blab'].style.visibility='visible';
document.all['blub'].style.clip="rect(0px, 0px, 0px, 0px)";
document.all['blob'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blab');
break;
case "blob":
clearTimeout(timer);
document.all['blob'].style.visibility='visible';
document.all['blub'].style.clip="rect(0px, 0px, 0px, 0px)";
document.all['blab'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blob');
break;
}} else if ((!document.all) && (document.getElementById)) {
switch (DivName) {
case "blub":
clearTimeout(timer);
ref=document.getElementById('blub');
ref.style.visibility='visible';
ref=document.getElementById('blab');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
ref=document.getElementById('blob');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blub');
break;
case "blab":
clearTimeout(timer);
ref=document.getElementById('blab');
ref.style.visibility='visible';
ref=document.getElementById('blub');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
ref=document.getElementById('blob');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blab');
break;
case "blob":
clearTimeout(timer);
ref=document.getElementById('blob');
ref.style.visibility='visible';
ref=document.getElementById('blub');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
ref=document.getElementById('blab');
ref.style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blob');
break;
}} else if (document.layers) {
switch (DivName) {
case "blub":
clearTimeout(timer);
document.layers['blub'].style.visibility='visible';
document.layers['blab'].style.clip="rect(0px, 0px, 0px, 0px)";
document.layers['blob'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blub');
break;
case "blab":
clearTimeout(timer);
document.layers['blab'].style.visibility='visible';
document.layers['blub'].style.clip="rect(0px, 0px, 0px, 0px)";
document.layers['blob'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blab');
break;
case "blob":
clearTimeout(timer);
document.layers['blob'].style.visibility='visible';
document.layers['blub'].style.clip="rect(0px, 0px, 0px, 0px)";
document.layers['blab'].style.clip="rect(0px, 0px, 0px, 0px)";
divHeight=0;
startAnimation('blob');
break;
}}
}
function startAnimation(DivName) {
var divHeight;
if (document.all) {
if (divHeight<101) {
document.all[DivName].style.clip="rect(0px, auto, "+divHeight+"px, 0px)";
divHeight++;
timer=setTimeout("startAnimation('"+DivName+"')", 100);
}
} else if ((!document.all) && (document.getElementById)) {
if (divHeight<101) {
ref=document.getElementById(DivName);
ref.style.clip="rect(0px, 0px, "+divHeigt+"px, 0px)";
divHeight++;
timer=setTimeout("startAnimation('"+DivName+"')", 100);
}
} else if (document.layers) {
if (divHeight<101) {
document.layers[DivName].style.clip="rect(0px, 0px, "+divHeight+"px, 0px)";
divHeight++;
timer=setTimeout("startAnimation('"+DivName+"')", 100);
}
}}
</script>
</head>
<body>
<table cellpadding=0 cellspacing=0 border=1 width=300>
<tr>
<th width=100><a href="#" onclick="menue('blub')">Menue01</a></th>
<th width=100><a href="#" onclick="menue('blab')">Menue02</a></th>
<th width=100><a href="#" onclick="menue('blob')">Menue03</a></th>
</tr>
</table>
<div id="blub" align="center" style="clip:rect(0,0,0,0); position:absolute; visibility:visible; height:100px; width=100px; top:40px; left:10px; background-color:#CCCCCC;">
Menue01.1<br>Menue01.2<br>Menue01.3
</div>
<div id="blab" align="center" style="clip:rect(0,0,0,0); position:absolute; visibility:visible; height:100px; width=100px; top:40px; left:110px; background-color:#004080;">
Menue02.1<br>Menue02.2<br>Menue02.3
</div>
<div id="blob" align="center" style="clip:rect(0,0,0,0); position:absolute; visibility:visible; height:100px; width=100px; top:40px; left:210px; background-color:#00ff00;">
Menue03.1<br>Menue03.2<br>Menue03.3
</div>
</body>
</html>
ich hoffe ihr findet diesen blöden fehler
greetings [23]^5^