Forum Moderators: open

Message Too Old, No Replies

image.src problem in Opera 7.50

Change image.src in Opera 7.50 doesn't display image

         

pbastov

12:30 pm on Feb 23, 2005 (gmt 0)

10+ Year Member



Hi,

I experience the following problem with image changing in Opera 7.50. I need to change image _preloading_ (to save bandwidth), but intead display it by user request when he/she clicks the link. While the image is being loaded a small .gif like "loading ..." is displayed. Once the image is loaded it is displayed.

To change image I assign its src property to the image on the server like this:

document.images['my_image'].src = 'some_image.jpg';

This method works well in Firefox 1.0, IE 6.0, Opera 8 beta, but fails in Opera 7.50+.

If instead I preload the image like this:

var img = new Image();
img.src = 'some_image.jpg';

and later make assignment

document.images['my_image'].src = img.src it works well in Opera 7.50 as well.

So, is it a known issue and is there way to resolve it?

Thanks in advance.

orion_rus

8:52 am on Feb 24, 2005 (gmt 0)

10+ Year Member



if Opera didn't shows it. You can't make an output for it in a such way. I suggest you to use following:
<img src='dsadas.gif' id='hiddenimage' style='display:none'>
then all loads u can change display to 'block' and it shows good
other way is to use
img=document.createElement('img');
img.src='dasdas.gif';
document.body.appendChild(img);

I think it should work good luck to you

pbastov

5:34 am on Feb 25, 2005 (gmt 0)

10+ Year Member



This doesn't seem to work either. Once I remove old image and add new one Opera 7.50 displays no image but text "Image" instead. If I right-click the image and choose "Load image" it is loaded though.

Anyway, thanks for your reply.

orion_rus

8:10 am on Feb 25, 2005 (gmt 0)

10+ Year Member



in the 1 way u can type instead of display:none to visibility:none.
Try this i think it should work

pbastov

6:52 am on Feb 26, 2005 (gmt 0)

10+ Year Member



The first method will make browser load the image it refers to, thus if I have 10 <img> tags all the 10 images will be loaded. What I need is to load only one image and load the others only when user selects their thumbshots.

Hope I made it clear.

Again, thanks for your reply.