Update: Now that Facebook allows Tabs to be <iframe>s you can use animated gifs in the iframe without the need for the old school and now defunct FBML trick described below. Check out this example tab.

Animated GIF for FacebookEver tried to put an animated GIF on a Facebook tab? They work fine in the left sidebar boxes but unfortunately are cached by Facebook and served from their CDN. This causes the image’s animation features to be lost. However calling a remote stylesheet will allow the images linked from that sheet to not be cached and thus pull from your own servers directly and animate properly. Check out my example of an animated gif on facebook.

Code for your FBML tab:

<link href="http://example.com/stylesheet.css" />

<div id="Ani">animated gif from stylesheet</div>

Code for your Stylesheet:

#Ani {
	background: white url(http://example.com/animated.gif) no-repeat;
	width: 100px;
	height: 100px;
	display: block;
	text-indent: -5000px;
}
Enhanced by Zemanta