FF don´t play my gif animations when I change the adress through the Javascript on http://camo.tym.sk/atelier/animacie.php
FF on Win XP don´t play my gif animations when I change the adress through the Javascript on http://camo.tym.sk/atelier/animacie.php Interesting on it is that the firs gif play corectly and gifs on others sites plays too. But when I try to change the adress throungh the JS somee of the images stay on the first frame. The about:config is ok. I can´t find the explanation of this problem anywhere. Can you help me please? Thanks!
Všetky odpovede (8)
I only had a few minutes to look at this, and I don't know the answer. However, if you create a text page where you do not hide the <img> tag, does that make any difference?
I noticed if I right-click the "stuck" GIF and View Image Info, it seems to restart the animation after a few moments. But I don't know of a way to achieve that effect in script.
How you mean it with that "not hide" the img? I need it for the loading ring... But I found some solution through the preloading images. You can see it in the code like function prednatahni(url)(is in the /* */ while it is on the forums). It works, but I still don´t understant why FF do this with gifs and I would like to know it, so still waiting for an answer.
If the animation doesn't start then a second click on the same link works for me to see the animation.
Hi, interesting that I didn´t found out it till now. It works too, but I still like to know why FF do it. So now we have two solutions: preloading imgs and two cliks on the same link. Thanks for help!
Maybe your script does something that interrupts the animation or loading the image and a second click on the same link bypasses it because the image is already selected.
In that case a timeout may help to delay the actions until the image has been loaded.
This is tha whole script:
- var Gwhich=;
- function zobraz1(url,which){
- document.getElementById('obrazok').style.visibility='hidden';
- document.getElementById('obrazok').src='animacieIMGs/'+url;
- which.style.color='green';
- if(Gwhich != ) Gwhich.style.color='#cc3366';
- Gwhich=which;
- }
- function onloadIMG(){
- document.getElementById('obrazok').style.visibility='visible';
- }
What can be the reason of that problem? Any other browsers don´t see there any problem and me too...?
Upravil(a) Camo dňa
I had a similar problem. Updating animated gifs with document.getElementById('img_id').src=next_gif; works 2 or 3 times, but than the next gifs halt at the first frame.
Inserting an extra document.getElementById('img_id').src=""; before changing to the new gif did the trick for me.
???
Thank you Rymaer very much. It works very good. Better than preloading what I had to made, cause preload in IE don´t want to show one of my gif. It was totaly horrible and illogical. Now it works fine. Thanks a lot once again!!!