I'm trying to run code that fires after the loading is complete on an image I'm bringing in with response.js. If the image was embedded in the html traditionally the following would work...
$(".textonphoto img").one('load', function() {
// image load function
}).each(function() {
if(this.complete) {
// image completely loaded.
}
});
But this doesn't fire on img elements brought in through response.js
The issue I'm having is that firing the event using .ready or .resize (R.action) works fine, but the image might not be completely loaded. So where I'm asking for the height of the image, it might come back with zero as a result.
There's a little plugin developed to deal with this issue in a traditional image tags... http://desandro.github.io/imagesloaded/ But this wouldn't detect img's in response.js data tags that I'm using
<div
data-min-width-641="<img src='../img/issue01/world-asia.jpg'>"
data-min-width-1025="<img src='../img/issue01/world-asia-big.jpg'>">
</div>
I'm trying to run code that fires after the loading is complete on an image I'm bringing in with response.js. If the image was embedded in the html traditionally the following would work...
But this doesn't fire on img elements brought in through response.js
The issue I'm having is that firing the event using .ready or .resize (R.action) works fine, but the image might not be completely loaded. So where I'm asking for the height of the image, it might come back with zero as a result.
There's a little plugin developed to deal with this issue in a traditional image tags... http://desandro.github.io/imagesloaded/ But this wouldn't detect img's in response.js data tags that I'm using