Mindjogger
New member
Hallo,
wie kann ich einem initialisiertem Array neue Werte unterschieben? Folgendes habe ich am laufen:
<script>
// =======================================
// set the necessary variables
// =======================================
var pictures_speed = 3000
var crossFadeDuration = 2
// Specify the image files
var Pic = new Array()
Pic[0] = 'img001.jpg'
Pic[1] = '../fotos_alle/p1010001.jpg'
Pic[2] = '../fotos_alle/p1010002.jpg'
Pic[3] = '../fotos_alle/p1010003.jpg'
Pic[4] = '../fotos_alle/p1010004.jpg'
Pic[5] = '../fotos_alle/p1010005.jpg'
var makefilm
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad = new Image()
preLoad.src = Pic
}
function runpictures(){
if (document.all){
document.images.pictures.style.filter="blendTrans(duration=2)"
document.images.pictures.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.pictures.filters.blendTrans.Apply()
}
document.images.pictures.src = preLoad[j].src
if (document.all){
document.images.pictures.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)){
j=0;
var Pic = new Array() // Ab hier hänge ich weshalb nimmt er das nicht ?
Pic[1] = '../fotos_alle/p1010006.jpg'
Pic[2] = '../fotos_alle/p1010007.jpg'
Pic[3] = '../fotos_alle/p1010008.jpg' // ich kann ihm das do ch so unterschieben
Pic[4] = '../fotos_alle/p1010009.jpg' // oder fehlt ein Teil
Pic[5] = '../fotos_alle/p1010010.jpg' // Bis hier hänge ich
}
makefilm = setTimeout('runpictures()', pictures_speed)
}
</script>
Hintergrund der Aktion ist, das er bbeim Laden der Seite erst einmal das PreLoad macht - und damit hängt der Rest und ich haue dem Besucher den Cache und das Mem voll.
Da es sich um ca. 50-60 Bilde rhandelt muss ich das also häppchenweise machen.
Hat jemand einen Ansatz hierfür ?
Danke.
Bernhard Stillger
wie kann ich einem initialisiertem Array neue Werte unterschieben? Folgendes habe ich am laufen:
<script>
// =======================================
// set the necessary variables
// =======================================
var pictures_speed = 3000
var crossFadeDuration = 2
// Specify the image files
var Pic = new Array()
Pic[0] = 'img001.jpg'
Pic[1] = '../fotos_alle/p1010001.jpg'
Pic[2] = '../fotos_alle/p1010002.jpg'
Pic[3] = '../fotos_alle/p1010003.jpg'
Pic[4] = '../fotos_alle/p1010004.jpg'
Pic[5] = '../fotos_alle/p1010005.jpg'
var makefilm
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad = new Image()
preLoad.src = Pic
}
function runpictures(){
if (document.all){
document.images.pictures.style.filter="blendTrans(duration=2)"
document.images.pictures.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.pictures.filters.blendTrans.Apply()
}
document.images.pictures.src = preLoad[j].src
if (document.all){
document.images.pictures.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)){
j=0;
var Pic = new Array() // Ab hier hänge ich weshalb nimmt er das nicht ?
Pic[1] = '../fotos_alle/p1010006.jpg'
Pic[2] = '../fotos_alle/p1010007.jpg'
Pic[3] = '../fotos_alle/p1010008.jpg' // ich kann ihm das do ch so unterschieben
Pic[4] = '../fotos_alle/p1010009.jpg' // oder fehlt ein Teil
Pic[5] = '../fotos_alle/p1010010.jpg' // Bis hier hänge ich
}
makefilm = setTimeout('runpictures()', pictures_speed)
}
</script>
Hintergrund der Aktion ist, das er bbeim Laden der Seite erst einmal das PreLoad macht - und damit hängt der Rest und ich haue dem Besucher den Cache und das Mem voll.
Da es sich um ca. 50-60 Bilde rhandelt muss ich das also häppchenweise machen.
Hat jemand einen Ansatz hierfür ?
Danke.
Bernhard Stillger