Erster Teil des Programm-Codes (steht in dem <head> </head> Teil):
<script language="JavaScript">
<!--
var i = 1
images = new Array
images[1] = "bild1.gif"
images[2] = "bild2.gif"
images[3] = "bild3.gif"
images[4] = "bild4.gif"
images[5] = "bild5.gif"
images[6] = "bild6.gif"
images[7] = "bild7.gif"
images[8] = "bild8.gif"
images[9] = "bild9.gif"
function gallery(){
if (i == 1){
document.gallery.previous.value=""
}
}
function previmg(){
if (i != 1) {
i --
document.img.src = images[i]
document.gallery.next.value = "Nächstes >"
}
if (i == 1) {
document.gallery.previous.value=""
}
}
function nextimg(){
if (i != 9) {
i ++
document.gallery.previous.value="< Vorheriges"
image = images[i]
document.img.src = image}
if (i ==9){
document.gallery.next.value="";
}
}
function pickrand(){
var imagenumber = 9 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1;
var randimage = images[rand1]
document.img.src = randimage
i = rand1
if (i == 1){
document.gallery.previous.value="";
}
else {
document.gallery.previous.value="< Vorheriges";
}
if (i == 6){
document.gallery.next.value="";
}
else {
document.gallery.next.value="Nächstes >";
}
}
function firstimg(){
i = 1
document.img.src = images[i];
document.gallery.previous.value=" ";
document.gallery.next.value="Nächstes >"
}
function lastimg(){
i = 9
document.img.src = images[i];
document.gallery.next.value=" "
document.gallery.previous.value="< Vorheriges"
}
function stoperror(){
return true
}
window.onerror=stoperror
// -->
</script>
Zweiter Teil des Programm-Codes (steht in dem <body> </body> Teil):
<TABLE align="center" border="0" width="550" height="350">
<TR>
<TD height="300">
<div align="center">
<img border="0" name="img" src="../main/restart/dia_show/bild1.JPG">
</div>
</TD>
</TR>
<TR>
<TD align="center">
<form name="gallery">
<input name="previous" onclick="previmg();" type="button" value="<Vorheriges">
<input name="first" onclick="firstimg();" type="button" value="|<< Start">
<input name="random" onclick="pickrand();" type="button" value="Zufall">
<input name="last" onclick="lastimg();" type="button" value="Letztes >>|">
<input name="next" onclick="nextimg();" type="button" value="Nächstes >">
</form>
<DIV style="visibility:hide;visibility:hidden;">
<FONT class="stn">|</font>
<a href="javascript:onclick=previmg()"><FONT class="sln">vorheriges</a>
<FONT class="stn">|</font>
<a href="javascript:onclick=firstimg()"><FONT class="sln">Start</a> <FONT
class="stn">|</font>
<a href="javascript:onclick=pickrand()"><FONT class="sln">Zufall</a> <FONT
class="stn">|</font>
<a href="javascript:onclick=lastimg()"><FONT class="sln">letztes</a> <FONT
class="stn">|</font>
<a href="javascript:onclick=nextimg()"><FONT class="sln">nächstes</a> <FONT
class="stn">|</font>
</div>
</TD>
</TR>
</TABLE>
|