Swap images and retain height? IE6=good... Opera6=bad

  • Thread starter The Plankmeister
  • Start date
T

The Plankmeister

I have a list of images, all with the same width, but each with a different
height. I also have a method of swapping these pictures around within the
list. In IE, the images all automatically resize themselves perfectly. In
Opera, the image sizes are static, so that when image 1 is swapped with
image 2, the size doesn't 'follow' the image, which means that one image
ends up squashed, the other stretched. I've tried programmatically
getting/setting the height.....

var fred = new Image();
fred = document.getElementById("thumb1").src;

h1 = document.getElementById("thumb1").height;
h2 = document.getElementById("thumb2").height;

document.getElementById("thumb1").src =
document.getElementById("thumb2").src;
document.getElementById("thumb1").height = h2;

document.getElementById("thumb2").src = fred;
document.getElementById("thumb2").height = h1;


......but it doesn't work. The image size seems stuck from the initial image.
Is it even possible to change the image size? I'm testing this in Opera
6/IE6.


Plankmeister.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top