I'm trying to display an animated GIF after a button click. The image is displayed correctly but it doesn't start animating. I tried many techniques (wrapping it with a div, SetTimeOut...) but none is able to display the animated GIF on laptops and mobile devices. Some techniques work on laptops but not on mobile devices such as setting the timeout in javascript. Here is the code. How can I make it work for both laptops and mobile devices:
<script>
function AnimateGif()
{
$("#anim_upload").css("display", "");
}
</script>
<asp:ImageButton CssClass="uploadedFile_btn" runat="server" ImageUrl="icon-upload2.png" ID="uploadedFile" OnClick="Button1_Click1" OnClientClick="AnimateGif();"/></div>
<img alt="" src="anim_upload.gif" id="anim_upload" style="display:none" />
LAPTOP solution
The following works well on laptops but it doesn't seem to work on most mobile devices. Wonder why!!!
<script>
function AnimateGif()
{
setTimeout('document.getElementById("anim_upload").style.display = "block"', 200);
}
</script>