Having Trouble with Lightbox 2.03.3 in Safari 3.x?

Well I know I sure was. I came across a bug where images could be displayed smaller or bigger than they should depending on what you clicked on before that image.

I've patched the lightbox.js to make this bug go away. In lighbox class' changeImage method I modified the imgPreloader.onload function.

...
// once image is preloaded, resize image container
imgPreloader.onload=function(){
  Element.setSrc('lightboxImage', imageArray[activeImage][0]);

  //unimatrixZxero edited fist at 2008-02-20 23:25
  //adding these attr setters for bug fix in Safari 3.x
  Element.setWidth('lightboxImage', imgPreloader.width);
  Element.setHeight('lightboxImage', imgPreloader.height);
	
  myLightbox.resizeImageContainer(imgPreloader.width, 
                                  imgPreloader.height);

  //clear onLoad, IE behaves irratically with animated gifs otherwise 
  imgPreloader.onload=function(){};
}
...
photo
Sam Figueroa

I am a young web developer with skills in PHP, Ruby on Rails, and XHTML/CSS.

Currently I'm learning about the Magento e-commerce shop in my spare time.

When I'm not coding I love to take pictures. I have a passion for photography. It fulfills me in creative ways. Take a look at some of my pictures.

Gerhart-Hauptmann-Str. 13
Nordwalde, 48356, NRW
Germany

iStockphoto Refferal Banner depicting iStockphoto logo