Click to See Complete Forum and Search --> : wrong image size/format nn4 /opera6 vs ie5+ / nn5+


markvl
01-07-2003, 03:54 PM
I'm trying to make a slideshow-script compatible with different browsers. It now works fine with nn5+ and ie5+.
I'm referencing the SRC from an image with a javascript function, so I can change the image while staying on the same (unchanged) page.
First I used: <IMG SRC="" NAME="MySlide">, filling the SRC with a function using document.images.MySlide.src="imgx.jpg".
Fine with ie5+/nn5+, but nn4 only shows a very small square picture (the images are either landscape or portrait). When filling the SRC with a reference to the first picture (SRC="img1.jpg"), and only using the javascript function for the next (or previous) ones, nn4 shows the image in the right size. But it keeps the format (either landscape or portrait) of the first picture for all following ones. Again, ie5+ and nn5+ show it right, while opera does more or less the same as nn4.
What can I do/change to make nn4 and opera behave the way I want?

gil davis
01-07-2003, 05:01 PM
For NS 4.x, swapping the SRC does not make the space adapt to the actual size of the new image. For example, if the original image is 100px X 100px, and you change the SRC to an image that is 200px X 200px, the image will change but it will still be 100px X 100px. You will have to use document.write() in a layer to make the space adapt to the actual size of the image.

I don't know about Opera.