Gif only looping once
You need to add application extension to force looping:
0x21,0xFF,0x0B,"NETSCAPE","2.0",0x03,0x01,0x00,0x00,0x00
Place it anywhere after GIF header and before first image header
for more info see Animated gif only loops once in Chrome and Firefox
After I done it to your GIF it loops:
Animated gif won't loop in Safari Chrome or Firefox
"loop" does not appear within attribute lists for IMG elements specified by any of the HTML3, HTML4 or HTML5 standards.
Like you I have read or seen "loop" described somewhere (and some time ago) but it does not appear to have ever been standardized.
The safest option would be to re-edit the gif files and when saving them specify a loop count of 0 (or infinite if the editor presents that as the choice). You might like to try loop="0"
in the IMG
tag first but as mentioned I don't think it's standard and could easily fail.
how do i get a single loop gif to play on firefox/chrome
try simply this code
setTimeout(function() { setInterval(function() { $('#gif_animata').attr('src',$('#gif_animata').attr('src')) },1) }, 2000)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><img id="gif_animata" src="http://www.lmpenterprises.co.uk/ekmps/shops/pearl/resources/image/animated-gif-2-f.gif" />
How to create a gif animation that plays only once
Browsers interpret differently the loop counter. For a single loop gif, Chrome is looping twice while Firefox is playing the animation exactly once.
See this issue of GifCreator - Unable to create non loop GIF image.
How to stop an animated gif from looping
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.
Related Topics
How to Remove an Item from an Array in Angularjs Scope
How to Toggle Class Using Pure JavaScript in HTML
Creating a CSS Class in Jquery
Toggle Divs Without Using JavaScript
Draw a Circle Around Nodes Groups
How to Detect the Screen Resolution with JavaScript
Create an Array with Same Element Repeated Multiple Times
Include Jquery in the JavaScript Console
JavaScript Variable Definition: Commas VS. Semicolons
HTML - How to Show Tooltip Only When Ellipsis Is Activated
How to Select All Text in Contenteditable Div
How to Inject a Style with an "!Important" Rule
React Inline Style - Style Prop Expects a Mapping from Style Properties to Values, Not a String
Div Square, Width Size Based on 100% Height
JavaScript Equivalent of Ruby's String#Scan