diff options
Diffstat (limited to 'phpfspot.js')
-rw-r--r-- | phpfspot.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/phpfspot.js b/phpfspot.js index ebe1242..75d0ed7 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -660,17 +660,19 @@ function preloadPhotos(image_url) { var waiting = 100; var counting; - lbImg=WSR_getElementsByClassName(document,"img","thumb"); - for(i=0;i<lbImg.length;i++){ - lbImg[i].src=image_url[i]; - // to not bomb the server with requests, give the page some time - // to load the images one by one. if a image exceeds the timeout, - // the next image will be loaded. - if(lbImg[i].complete != undefined && lbImg[i].complete != true) { - counting = 0; - while(lbImg[i].complete != true && counting < timeout) { - window.setTimeout("noop()", waiting); - counting+=waiting; + lbImg = WSR_getElementsByClassName(document,"img","thumb"); + if(lbImg != undefined) { + for(i=0;i<lbImg.length;i++){ + lbImg[i].src=image_url[i]; + // to not bomb the server with requests, give the page some time + // to load the images one by one. if a image exceeds the timeout, + // the next image will be loaded. + if(lbImg[i].complete != undefined && lbImg[i].complete != true) { + counting = 0; + while(lbImg[i].complete != true && counting < timeout) { + window.setTimeout("noop()", waiting); + counting+=waiting; + } } } } |