Animated gif stops after click

I put animated gif inside <a href> tag to open a web dialog. The gif stops its animation after the mouse click.
How can i avoid this stop?
galorAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ahosangConnect With a Mentor Commented:
You may be using something like:
<a href="javascript:yourFunction()"> which is deprecated
or :
<a href="#" onclick="yourFunction()">

The way to stop javascript from messing with animated gifs(and the best way in any case) is:
<a href="#" onclick="yourFunction();return false">
0
 
avnerCommented:
You cannot, as long as you use a modal popup the web-engine stop responding untill you come back from the modal window/popup.
0
 
galorAuthor Commented:
The problem is that it does not restart the animation after the popup window is closed.
Any suggestion?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
COBOLdinosaurCommented:
Reload the gif when you come back from the popup.

if the image is:

<img name="thegif" src="myimage.gif">

Then document.images['thegif'].src="myimage.gif";

Should restart it.

Though you might have to actually clear it with:
document.images['thegif'].src="";
document.images['thegif'].src="myimage.gif";

There should not be a deley reloading because it will be in cache.

Cd&

0
 
galorAuthor Commented:
Very good. It is working!
0
 
ahosangCommented:
Glad to help
0
All Courses

From novice to tech pro — start learning today.