Changeset 30

Show
Ignore:
Timestamp:
07/18/06 00:40:12 (2 years ago)
Author:
tim
Message:

fixes the broken images when in theme view, and also replaces
the spinner with the close button so that people won't get confused
when they click on an image that doesn't exist.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/public/javascripts/lightbox.js

    r29 r30  
    6060//      Configuration 
    6161// 
    62 var fileLoadingImage = "images/loading.gif";             
    63 var fileBottomNavCloseImage = "images/closelabel.gif"; 
     62var scriptsElements = document.getElementsByTagName('script'); 
     63var imgbase = ""; 
     64for(var x = 0; x < scriptsElements.length; x++){ 
     65    if(scriptsElements[x].src.indexOf('lightbox.js') > 0){ 
     66        imgbase = scriptsElements[x].src.substring(0, scriptsElements[x].src.indexOf('lightbox.js')); 
     67    } 
     68} 
     69 
     70var fileLoadingImage = imgbase + "../images/loading.gif";                
     71var fileBottomNavCloseImage = imgbase + "../images/closelabel.gif"; 
    6472 
    6573var resizeSpeed = 7;    // controls the speed of the image resizing (1=slowest and 10=fastest) 
     
    268276         
    269277                var objLoadingImage = document.createElement("img"); 
    270                 objLoadingImage.setAttribute('src', fileLoadingImage); 
    271278                objLoadingImage.setAttribute('src', fileBottomNavCloseImage); 
    272279                objLoadingLink.appendChild(objLoadingImage);