Array - layers - Haster..
HJÆLP!!!Jeg har lavet det denne side..
Iden med siden er at når man trykker på et af linkene i tabellen skifter teksten i laget. Næste gang man trykker på samme link skifter teksten til næste plads i det array som passer til linket(cellen).
Der er en counter til hvert link, så man ikke kommer ud over array\'et størelse..
Håber at der er nogle som gider at forsøge..
--------------------------------------------
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
<head>
<title>Untitled</title>
<script language=\"JavaScript\">
<!--
ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;
var CountA1 = 0, CountA2 = 0, CountA3 = 0, CountA4 = 0, CountA5 = 0, CountA6 = 0, CountA7 = 0;
var CountB1 = 0, CountB2 = 0, CountB3 = 0, CountB4 = 0, CountB5 = 0, CountB6 = 0, CountB7 = 0;
var CountC1 = 0, CountC2 = 0, CountC3 = 0, CountC4 = 0, CountC5 = 0, CountC6 = 0, CountC7 = 0;
var CountD1 = 0, CountD2 = 0, CountD3 = 0, CountD5 = 0, CountD6 = 0, CountD7 = 0;
var CountE1 = 0, CountE2 = 0, CountE3 = 0, CountE4 = 0, CountE5 = 0, CountE6 = 0, CountE7 = 0;
var CountF1 = 0, CountF2 = 0, CountF3 = 0, CountF4 = 0, CountF5 = 0, CountF6 = 0, CountF7 = 0;
var CountG1 = 0, CountG2 = 0, CountG3 = 0, CountG4 = 0, CountG5 = 0, CountG6 = 0, CountG7 = 0;
A1 = new Array(2) ;
A1[0] = \'Det var 1. gang!!\' ;
A1[1] = \'Det var 2. gang\' ;
A1[2] = \'Det var så 3. gang<b>Hvad tror du der sker næste gang?\' ;
A2 = new Array(2) ;
A2[0] = \'11111111111\' ;
A2[1] = \'22222222222222\' ;
A2[2] = \'333333333333<b>111111111\' ;
A3 = new Array(2) ;
A3[0] = \'erewr rwe wer\' ;
A3[1] = \'wer wer\' ;
A3[2] = \'BØHHHHHH!!!!!\' ;
A4 = new Array(1) ;
A5 = new Array(2) ;
A6 = new Array(3) ;
A7 = new Array(2) ;
B1 = new Array(2) ;
B2 = new Array(2) ;
B3 = new Array(2) ;
B4 = new Array(1) ;
B5 = new Array(2) ;
B6 = new Array(3) ;
B7 = new Array(2) ;
C1 = new Array(2) ;
C2 = new Array(2) ;
C3 = new Array(2) ;
C4 = new Array(1) ;
C5 = new Array(2) ;
C6 = new Array(3) ;
C7 = new Array(2) ;
D1 = new Array(2) ;
D2 = new Array(2) ;
D3 = new Array(2) ;
//-- D4 = new Array(1) ; Billede !!
D5 = new Array(2) ;
D6 = new Array(3) ;
D7 = new Array(2) ;
E1 = new Array(2) ;
E2 = new Array(2) ;
E3 = new Array(2) ;
E4 = new Array(1) ;
E5 = new Array(2) ;
E6 = new Array(3) ;
E7 = new Array(2) ;
F1 = new Array(2) ;
F2 = new Array(2) ;
F3 = new Array(2) ;
F4 = new Array(1) ;
F5 = new Array(2) ;
F6 = new Array(3) ;
F7 = new Array(2) ;
G1 = new Array(2) ;
G2 = new Array(2) ;
G3 = new Array(2) ;
G4 = new Array(1) ;
G5 = new Array(2) ;
G6 = new Array(3) ;
G7 = new Array(2) ;
function spg(Cell)
{
var id = \'LayerSvar\'
var ArLng = eval(Cell).length ;
var Counter = eval(\'Count\' + Cell) ;
if (Counter > ArLng)
{
eval(\'Count\' + Cell) = 0 ;
}
var SpgNr = eval(Cell[Counter]) ;
if (ns4)
{
var lyr = (nestref)? eval(\'document.\'+nestref+\'.document.\'+id+\'.document\') : document.layers[id].document ;
lyr.open();
lyr.write(SpgNr) ;
lyr.close() ;
}
else if (ie4)
{
document.all[id].innerHTML = SpgNr ;
}
eval(\'Count\' + Cell) + 1 ;
}
//-->
</script>
</head>
<body>
<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"350\" height=\"350\">
<tr align=\"center\" valign=\"middle\">
<td width=\"50\" height=\"50\"><A HREF=\"A1\" onclick=\"spg(\'A1\');return false\">A1</td>
<td width=\"50\" height=\"50\">A2</td>
<td width=\"50\" height=\"50\">A3</td>
<td width=\"50\" height=\"50\">A4</td>
<td width=\"50\" height=\"50\">A5</td>
<td width=\"50\" height=\"50\">A6</td>
<td width=\"50\" height=\"50\">A7</td>
</tr>
<tr align=\"center\" valign=\"middle\">
<td width=\"50\" height=\"50\">B1</td>
<td width=\"50\" height=\"50\">B2</td>
<td width=\"50\" height=\"50\">B3</td>
<td width=\"50\" height=\"50\">B4</td>
<td width=\"50\" height=\"50\">B5</td>
<td width=\"50\" height=\"50\">B6</td>
<td width=\"50\" height=\"50\">B6</td>
</tr>
<tr align=\"center\" valign=\"middle\">
<td width=\"50\" height=\"50\">C1</td>
<td width=\"50\" height=\"50\">C2</td>
<td width=\"50\" height=\"50\">C3</td>
<td width=\"50\" height=\"50\">C4</td>
<td width=\"50\" height=\"50\">C5</td>
<td width=\"50\" height=\"50\">C6</td>
<td width=\"50\" height=\"50\">C7</td>
</tr>
<tr align=\"center\" valign=\"middle\">
<td width=\"50\" height=\"50\">D1</td>
<td width=\"50\" height=\"50\">D2</td>
<td width=\"50\" height=\"50\">D3</td>
<td width=\"50\" height=\"50\"><font size=\"1\"><b><i>Billede</i></b></font></td>
<td width=\"50\" height=\"50\">D5</td>
<td width=\"50\" height=\"50\">D6</td>
<td width=\"50\" height=\"50\">D7</td>
</tr>
<tr align=\"center\" valign=\"middle\">
<td width=\"50\" height=\"50\">E1</td>
<td width=\"50\" height=\"50\">E2</td>
<td width=\"50\" height=\"50\">E3</td>
<td width=\"50\" height=\"50\">E4</td>
<td width=\"50\" height=\"50\">E5</td>
<td width=\"50\" height=\"50\">E6</td>
<td width=\"50\" height=\"50\">E7</td>
</tr>
<tr align=\"center\" valign=\"middle\">
<td width=\"50\" height=\"50\">F1</td>
<td width=\"50\" height=\"50\">F2</td>
<td width=\"50\" height=\"50\">F3</td>
<td width=\"50\" height=\"50\">F4</td>
<td width=\"50\" height=\"50\">F5</td>
<td width=\"50\" height=\"50\">F6</td>
<td width=\"50\" height=\"50\">F7</td>
</tr>
<tr align=\"center\" valign=\"middle\">
<td width=\"50\" height=\"50\">G1</td>
<td width=\"50\" height=\"50\">G2</td>
<td width=\"50\" height=\"50\">G3</td>
<td width=\"50\" height=\"50\">G4</td>
<td width=\"50\" height=\"50\">G5</td>
<td width=\"50\" height=\"50\">G6</td>
<td width=\"50\" height=\"50\">G7</td>
</tr>
</table>
<div id=\"LayerSvar\" style=\"position:absolute; left:375px; top:12px; width:275px; height:350px; z-index:1\"></div>
</body>
</html>
-----------------------------------------
PainZ