Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
88
rated 0 times [  90] [ 2]  / answers: 1 / hits: 138003  / 11 Years ago, fri, october 4, 2013, 12:00:00

I have an animated gif in an img tag that I start by rewriting the src attribute. The gif was created, though, to loop and I only want it to play once. Is there a way, with Javascript or jQuery, to stop an animated gif from playing more than once?


More From » jquery

 Answers
168

Not sure if this is the best way to respond to everyone and have it appear after all the previous answers and comments, but it seems to work.



I don't have much control over the gif. People post whatever gif they want as the thankyou.gif in their account directory and then the ThankYou code runs whatever they've put there when a comment is submitted to a form they've posted. So some may loop, some may not, some may be short, some may be long. The solution I've come to is to tell people to make them 5 seconds, because that's when I'm going to fade them out, and I don't care if they loop or not.



Thanks for all the ideas.


[#75240] Thursday, October 3, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dequant

Total Points: 88
Total Questions: 99
Total Answers: 95

Location: Ukraine
Member since Sun, Dec 13, 2020
4 Years ago
dequant questions
;