Servus !!
Ich bau grad an ner Seite, in der an 2 Stellen Photos in zufälliger Reihenfolge durchwechseln.
Mit dem InternetExplorer ists kein Problem.
Der Netscapt zeigt mir die eine "Zufalls-slideshow" an, die andere nicht !
Hier mal das Skript:
<script LANGUAGE="JavaScript1.2">
<!-- Begin
var i=0;
var j=0;
var ges_array = new Array()
var ges_zeit = new Array()
var sponsor_array = new Array()
var sponsor_link = new Array()
var sponsor_zeit = new Array()
var ges_anzahl=5
ges_array[0]="images/ges/1.jpg", ges_zeit[0]=10
ges_array[1]="images/ges/2.jpg", ges_zeit[1]=10
ges_array[2]="images/ges/3.jpg", ges_zeit[2]=10
ges_array[3]="images/ges/4.jpg", ges_zeit[3]=10
ges_array[4]="images/ges/5.jpg", ges_zeit[4]=10
var sponsor_anzahl=2
sponsor_array[0]="sponsor/1.jpg", sponsor_link[0]="http://www.domain.de", sponsor_zeit[0]=25
sponsor_array[1]="sponsor/2.jpg", sponsor_link[1]="http://www.domain.de", sponsor_zeit[1]=25
function ges_rotation() {
i=Math.floor(Math.random()*ges_anzahl)
document.images.ges.src=ges_array[i]
setTimeout("ges_rotation()",ges_zeit[i]*1000)
}
function sponsor_rotation() {
j=Math.floor(Math.random()*sponsor_anzahl)
document.images.sponsor.src=sponsor_array[j]
setTimeout("sponsor_rotation()",sponsor_zeit[j]*1000)
}
function gotosponsor() {
window.open(sponsor_link[j])
}
// End -->
</script>
<body onload="ges_rotation(),sponsor_rotation()">
[...]
<img src="images/ges/1.jpg" NAME="ges">
<img src="sponsor/1.jpg" NAME="sponsor" onMouseDown="gotosponsor()">