Click to See Complete Forum and Search --> : Image .src update problem


Termite
07-14-2003, 07:05 AM
I have written a script to update the source in a big image when a thumbnail is clicked. The script works fine in my test but causes a problem when added to my target page.

The .src of the image changes but the image does not display. However, if I display an alert box in the changeimage function then it works. I have tried redrawing the image, re-sizing the window etc but the only way to get it to work is to display an alert box.

Any Ideas?

requestcode
07-14-2003, 08:13 AM
Can you give us a link to your code?

Termite
07-14-2003, 09:26 AM
I have attached a sample of the code I am using.

I have noticed that if I change a link to a file located relative to the web page then it works but when attempting to change the src to an absolutely referenced image it fails.

Termite
07-14-2003, 09:33 AM
I have just come across another problem.

Whilst using my working example I tried opening it by double clicking in windows, it works. However if I access the same page through IIS (http://localhost...) then I experience the same problems.

Termite
07-14-2003, 10:39 AM
Whilst experimenting with my problem I have discovered that the code works fine when called by the OnMouseOver event but fails when called by OnClick,

Any clues as to the reason for this would be appreciated.