Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image not displaying in IE

Status
Not open for further replies.

dougalim

Programmer
Mar 1, 2007
23
US
I have a div that contains a small image and a span element with info about the image.

I have a dynamic menu that changes the image src and the text for each option.

This works the very first time I click on any of the menu items. The problem is after subsequent menu clicks the image and the text change as expected, but the image does not display. If I right click where the image is and choose Show Picture, the image appears.

The images are preloaded and stored in objects. The code to swap the image is simply

Code:
var d = document.getElementById('coachImg');
d.src = coachObj.thumbnail.src;

Any ideas?





 
Hi

If someone will guess what the coachObj is and what its thumbnail property holds, will probably help you.

If you do not want to wait until that, give us more details.

Is that page available on-line ? If yes, we can look at its source. Is the script a free one found on the web ? If yes, we can read its documentation.

Feherke.
 
Try:

Code:
d.src = coachObj.thumbnail.src[!] + '?cacheBuster=' + new Date().getTime()[/!];

I know that defeats the point of the preload, but it might confirm whether the preload has worked or not.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top