I’ve have done a lot of searching around the web and have asked several developers around the office but can’t seem to come up with a good solution. Here’s the problem:
Say I have a image gallery that’s 800×300 pixels. My images that are going into that gallery are larger than that defined space. I can use jquery to size and center the images no problem… except the fact that I need to have the images loaded in order to size and position correctly. Fireing the function before the images are loaded breaks the whole thing.
Coming from a flash background in flash you would simple create an event listener for when the image load is complete then fire the function, but HTML and javascript are a bit tricker due to browser caching and IE.
Passing the width and height or knowing that before hand isn’t an option. It’s got to be dynamic and load on the fly.
doing it on
$(window).load(function(){
works, but what about the times you load images on the fly?
Anyone have any good ideas to over come this? Much appreciated.


