John said:
I am rotating images at one location of my web site. My problem is if
I set the width and height of the new image before I show the new
image, the old image is stretched first to the new image dimensions,
and if I show the new image before setting its dimensions, the new
image is stretched first to the old image dimension before it is
adjusted to its own dimension.
I would like to load a new image with its own dimension at the same
time. How can I do this?
Off the top of my head:
1. change the image to something amorphous, change the dimensions,
then change to your new image. The intermediate image could be
a solid color (white?) or it could be some sort of swirl to give
the impression of an image being rotated.
2. change the visibility of the image to hidden, update it, then
set it back to visible.
3. rewrite the entire <img> tag with the new image and dimensions.
Do all popular browsers allow you to change the dimensions of images
on the fly these days? Some older ones wouldn't allow that.
Do most current browsers allow you to change the dimensions of an
image after it's been rendered? Some older browsers won't.