<img> Tag frustration!

liunx

Guest
Hi Everyone,<br />
<br />
I am using a relatively simple javascript to create an online photoalbum effect. It involves using an initial <img> tag displaying the first photo, which then gets updated from an array with the next photo etc, etc.<br />
<br />
This works just great as long as all the images in the array are the same size, but the minute there's an image with a different size to that of the initial <img> "placeholder" tag, it gets weird on me.<br />
<br />
The different sized image takes on the dimensions of the first image...No, I'm not specifying width or height, either in pixels or percentage.<br />
<br />
Here's the funny part - when I view the source from the displayed page, the height and width is in the html and matches that of the first image. How is this possible? Is the browser doing this, and if so why???<br />
<br />
I've resorted to editing the file in a text editor and launching the saved file from outside Forntpage and the problem still persists - it sticks the width and height parameters in the img tag. This leads me to think it might be the browser.<br />
<br />
I'm using Frontpage and my IE browser version is 6. Any help on how to fix this/work around it so that images are displayed at actual dimension would be greatly appreciated!<br />
<br />
Thanks<br />
Stephan<br />
South Africa<!--content-->If you just change/swap the src value then you will always get this effect. You must then also change the width and height attribute values to co-inside with the new image.<br />
Images must be pre-loaded or the delay will still cause a distortion of the new image.<br />
<br />
Another way is to change the whole tag and insert it with the DOM innerHTML.<br />
<br />
Or take the dimensions of the largest image and use that size with a transparent background to copy other image onto; like a frame for the image.<!--content-->
 
Back
Top