I have a gif animation that will loop forever. However, I don’t want it to be visible all the time, so what I basicly need is to give the animation 3 seconds to run once, then hide it and after 10 seconds make it visible again for 3 seconds.
I currently have this, but it isn’t working:
<script type="text/javascript">
function autoupdate() {
$('#bird').delay(3000);
$('#bird').css('display', 'none'):
$('#bird').delay(10000);
$('#bird').css('display', 'block');
}
$(document).ready(function() {
setInterval("autoupdate()", 50);
});
</script>
There is a mistake in Neal’s solution as it will hidden for 13 seconds.. not 10.
I think the following will suit you better, and it does not contain those 50 millis workaround.
Here is my fiddle