Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Animated gif stops after click

Posted on 2002-06-06
6
Medium Priority
?
1,196 Views
Last Modified: 2013-11-19
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?
0
Comment
Question by:galor
6 Comments
 
LVL 14

Expert Comment

by:avner
ID: 7058717
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
 

Author Comment

by:galor
ID: 7058738
The problem is that it does not restart the animation after the popup window is closed.
Any suggestion?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7058967
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 12

Accepted Solution

by:
ahosang earned 800 total points
ID: 7059066
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
 

Author Comment

by:galor
ID: 7059384
Very good. It is working!
0
 
LVL 12

Expert Comment

by:ahosang
ID: 7059922
Glad to help
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question