menu schreiben
xunling
- javascript
0 xunling0 Gunnar Bittersmann
hallo
<html><head><title>^^</title>
<script type="text/javascript">
/* write array with cities, write multiarray with "reload" function
on load write depenndend subclass --s
write laender, sublaender, continents auslagern,
always load depend items from list
first load all continents, all countries
-> write 5 continents, write 5 countries
--
position = function Wunsch () {http://txu/ebaai.com/admin/try2.php
var Ziel = window.prompt("Ihr Wunsch-URI:", "");
window.location.href = Ziel;
}*/
function generateLaenderMenu (position) {
if (position == false)
var position = 0;
var countries = new Array();
countries.push("deutschland");
countries.push("frankreich");
countries.push("spanien");
countries.push("england");
countries.push("schweden");
countries.push("norwegen");
countries.push("russland");
countries.push("china");
countries.push("england");
countries.push("deutschland2");
countries.push("frankreich2");
countries.push("spanien2");
countries.push("england2");
countries.push("schweden2");
countries.push("norwegen2");
countries.push("russland2");
countries.push("china2");
countries.push("england2");
countries.push("deutschland3");
countries.push("frankreich3");
countries.push("spanien3");
countries.push("england3");
countries.push("schweden3");
countries.push("norwegen3");
countries.push("russland3");
countries.push("china3");
countries.push("england3");
countries.push("deutschland4");
countries.push("frankreich4");
countries.push("spanien4");
countries.push("england4");
countries.push("schweden4");
countries.push("norwegen4");
countries.push("russland4");
countries.push("china4");
countries.push("england4");
var content = "<table width=\"220\" cellpadding=\"4\" cellspacing=\"5\" border=\"1\">";
content += "<tr>";
content += " <td> ^^^^</td>";
content += "</tr>";
var i = 0;
if ((position + 1) * 5 < countries.length) {
while (i <= (position + 1) * 5 && i < countries.length) {
content += "<tr>";
content += " <td>" + countries[i] + " </td>";
content += "</tr>";
i ++;
}
}
content += "<tr>";
content += " <td><span class=\"style1\" onClick=\"generateLaenderMenu (" + position + 1 + ")\"> vvvv</span></td>";
content += "</tr>";
content += "</table>";
document.write(content);
}
</script>
<link href="style41.css" rel="stylesheet" type="text/css">
</head>
<body>
<br/>
<br/>
<br/>
<br/>
<script type="text/javascript">
generateLaenderMenu(0);
</script>
</body></html>
kann mir jemand bei diesem javascript menu helfen?
Ich moechte, dass ich bei on.click einen opurl aufruf habe, ich kann es nicht hinbekommen, dass sich das menu vernuenftig auf und zu faehrt....
vielen dank
xunling
ach Ja,
der link zu dem script ist hier: http://l3s7513.zeus07.de/test_menuscripting.html
und ich denke, dass ich ein schleifenproblem habe, weil der die vm denke ich abstuerzt ...
@@xunling:
content += " <td> ^^^^</td>";
Wenn du mehr als einmal ' ' hintereinander hast, machst du mit Sicherheit etwas falsch. Für Abstände ist CSS zuständig.
i ++;
Was sagt die Fehlerkonsole denn dazu? Du benutzt doch zum Testen einen Browser mit Fehlerkonsole, oder?
[…] dass sich das menu vernuenftig auf und zu faehrt....
Welches Menü? „Da is nix.“ [DIALOG-ROBOT]
Live long and prosper,
Gunnar
i ++;
Was sagt die Fehlerkonsole denn dazu?
Was soll sie dazu sagen? Operand und Operator dürfen durchaus durch Leerzeichen getrennt sein.
Mathias
@@molily:
i ++;
Was sagt die Fehlerkonsole denn dazu?
Was soll sie dazu sagen? Operand und Operator dürfen durchaus durch Leerzeichen getrennt sein.
Tja, man lernt nie aus.
Live long and prosper,
Gunnar
Tja, man lernt nie aus.
sieht aber komisch aus ;)
content += " <td> ^^^^</td>";
Wenn du mehr als einmal ' ' hintereinander hast, machst du mit Sicherheit etwas falsch. Für Abstände ist CSS zuständig.
fürs protokoll: auch wenn anfang oder ende text textes steht oder z.b. an ein leerzeichen angrenzt