I've been going at this a few days now and need help. I know that the .load() event doesn't get called if the image is cached in Safari so I came up with the code below.
It works in telling if the image is cached or not but it can't get the cached image's width and height. It comes up zero (in Safari). Any insight would be appreciated. Thanks.
var $_item = $('<div id="'+(name+itemIndex)+'" class="box" ><div class="image_back"><img src="'+ image_back +'" id="backcolor" /></div><div class="image_outline"><img src="'+ image_outline +'" /></div></div>').appendTo('body');
if( $('#backcolor', $_item)[0].complete ) {
el_w = $('#backcolor', $_item).width();
el_h = $('#backcolor', $_item).height();
console.log("cache*****" +":"+el_w+":"+":"+$('#backcolor', $_item)[0].width);
} else {
$('#backcolor', $_item).load( function() {
el_w = $('#backcolor', $_item).width();
el_h = $('#backcolor', $_item).height();
console.log("load*****" + this+":"+el_w);
});
}