M
MarkusJNZ
Hi, I am trying to change an image and it's associated width/ height
dynamically via Javascript.
In my HTML I have declared the following:
<table width="100%" class="details">
<tr>
<td
align="left">
<img id="largeImage" />
</td>
</tr>
</table>
where largeImage is the image I wish to change (Please note images can
be of different sizes)
I then have a javascript function which I call and pass in the name of
the image as well as the new size that I would like the image to be.
e.g.
function showImage(imageName, nHeight, nWidth)
{
document.getElementById('largeImage').src = './_listingImages/' +
imageName;
document.getElementById('largeImage').style.width=nWidth + "px;";
document.getElementById('largeImage').style.height=nHeight + "px;";
}
This does not seem to work at all; In firefox for example the page
length just seems to get bigger and bigger (The images do swap) and in
IE the width and height is just ignored.
Any help appreciated
Thanks
Markus
dynamically via Javascript.
In my HTML I have declared the following:
<table width="100%" class="details">
<tr>
<td
align="left">
<img id="largeImage" />
</td>
</tr>
</table>
where largeImage is the image I wish to change (Please note images can
be of different sizes)
I then have a javascript function which I call and pass in the name of
the image as well as the new size that I would like the image to be.
e.g.
function showImage(imageName, nHeight, nWidth)
{
document.getElementById('largeImage').src = './_listingImages/' +
imageName;
document.getElementById('largeImage').style.width=nWidth + "px;";
document.getElementById('largeImage').style.height=nHeight + "px;";
}
This does not seem to work at all; In firefox for example the page
length just seems to get bigger and bigger (The images do swap) and in
IE the width and height is just ignored.
Any help appreciated
Thanks
Markus