Menu
Any idea why the alert inside of the load function isn’t working?
[code=php]
preload: function(source,width,height) {
var proto = $(document.createElement(‘img’));
var w,h,r;
$(proto).load(function() {
alert(‘alert’);
w = proto.width;
h = proto.height;
r = width/w;
delete proto;
});
$(proto).attr(‘src’,src);
this.width = ‘100px’;
this.height = h * 3;
this.attr(‘src’,source);
}