Hello everybody, Im having some issues with the onload event of images.
I have some thumbnails, and when I click on any of them, a row displaying "Loading..." will have its 'display' property set to '' from none, at the same time, an image which has a blank gif will load the larger image.
When the larger image has been loaded, the "Loading..." row will have its display property set to none on the image's onLoad event. It works fine as long as I click on different thumbnails each time.
But if I click on the same thumbnail twice, the "Loading" row will not have its display property change to none on the second click.
Roughly here's the layout:
And here's part of the code I'm working on
I guess, when clicking on the tumbnail twice, on the 2nd time, the cached image will be loaded, but still, and image is being loaded, but onLoad="document.getElementById('theMess').style.display='none'" is not being triggered.
Thanks for any input.
I have some thumbnails, and when I click on any of them, a row displaying "Loading..." will have its 'display' property set to '' from none, at the same time, an image which has a blank gif will load the larger image.
When the larger image has been loaded, the "Loading..." row will have its display property set to none on the image's onLoad event. It works fine as long as I click on different thumbnails each time.
But if I click on the same thumbnail twice, the "Loading" row will not have its display property change to none on the second click.
Roughly here's the layout:
Code:
Thumb1 | Thumb2 | Thumb3 | Thumb4 ...
======================================
<tr id="theMess" style="display:none">...
LOADING...
</tr>
======================================
<img id="hdContainer"...
LARGER IMAGE
======================================
And here's part of the code I'm working on
Code:
The thumbnail(s):
<a href="#" class="xxx" onclick="hdContainer.src='path/big.jpg';document.getElementById('theMess').style.display='';return false;"><img src="path/small.jpg" /></a>
The larger image:
<img id="hdContainer" src="path/blank.gif" onLoad="document.getElementById('theMess').style.display='none'" />
I guess, when clicking on the tumbnail twice, on the 2nd time, the cached image will be loaded, but still, and image is being loaded, but onLoad="document.getElementById('theMess').style.display='none'" is not being triggered.
Thanks for any input.