I have an image I would like to load at 200px
by 200px
briefly, and then smoothly scale to 50px
on page load. I have done it with a show / hide technique, showing larger > then hide > showing smaller with fades; but I need the transition.
Thus far. But Turning out pretty ugly -
var bigSrc = "averycoolimage.jpg";
var img = new Image(),
oWidth, oHeight;
img.onload = function() {
oWidth = this.width;
oHeight = this.height;
this.width = 100;
this.height = 50;
this.id = "bigImg";
}
img.src = bigSrc;
$(function() {
$("#divId").append(img);
$("#bigImg").animate({
height: oHeight,
width: oWidth,
}, 500);
});