Arbejde med anchor objectet?
Jeg vil gerne arbejde med anchor objectet og har understående ønsker. Nogen der kan hjælpe?Pseudo kode:
- Hvis et anchor er eller har været blur, så brug style =”blurStyle;”
- Saml alle anchors - som er benævnt 01, 02, 03 o.s.v. - i dette dokument
- Sæt fokus på det første anchor.
- Hop med eventhandler til næste anchor og sæt focus.
- Blur alle tidligere anchors.
- Hvis der ikke er flere anchors i arrayet, så blur alle tidligere.
Understående er ikke ligefrem optimalt i automatiserede sammenhænge, men anskueliggøre måske alligevel lidt af ønskerne …
<table width="300px" align="center">
<tr>
<td> </td>
<tr>
<td><div align="center"><a href="#00" onClick="document.anchors[0].focus();">Jump
to Anchor A</a></div></td>
<tr>
<td><div align="center"><a href="#01" onClick="document.anchors[0].blur(); document.anchors[1].focus();">Jump
to Anchor B</a></div></td>
<tr>
<td><div align="center"><a href="#02" onClick="document.anchors[0,1].blur(); document.anchors[2].focus();">Jump
to Anchor C</a></div></td>
<tr>
<td><div align="center"><a href="#03" onClick="document.anchors[0,1,2].blur(); document.anchors[3].focus();">Jump
to Anchor D</a></div></td>
<tr>
<td><div align="center"><a href="#04" onClick="document.anchors[0,1,2,3].blur(); document.anchors[4].focus();">Jump
to Anchor E</a></div></td>
<tr>
<td><div align="center"><a href="#05" onClick="document.anchors[0,1,2,3,4].blur(); document.anchors[5].focus();">Jump
to Anchor F</a></div></td>
<tr>
<td> </td>
</table>
