I have a plugin which loads images after document ready.
In order for it to work, the image source looks like this:
The script shows the loader.gif until the image is loaded and then replaces that gif with the_actual_image.jpg
Here is how I call the function:
function mylazyload() {
$("img.lazy").show();
var timeout = setTimeout(function(){$(".models img.lazy").lazyload({effect : "fadeIn"})}, 800);
}
I have a re-size function which I call after the mylazyload(); function:
jQuery(document).ready(function($){
mylazyload();
resize_images();
});
Here is the re-size function:
function resize_images() {
var maxHeight = $(".defx img").height();
$(".model img.lazy").each(function() {
var $this = $(this);
if ($this.height() > maxHeight || $this.height() < maxHeight) {
$this.removeAttr('style').css("height","auto");
$this.css('height', maxHeight);
}
});
}
The PROBLEM is that the resize function seems to work on the loader.gif, not resizing the_actual_image.jpg.
Any ideas why?