Animated gif not animating on submit

gfrizzle picture gfrizzle · Jan 18, 2010 · Viewed 12.2k times · Source

I have a form where the submit function takes several minutes. I'd like to display an animated gif while the submit is cranking. The code below shows the gif, but it doesn't move. What can I do to get it going?

<script type="text/javascript">

    $(function() {
        $("#submit").click(function() {
            $("#wait").show();
            return true;
        });
    });

</script>

<% Using Html.BeginForm%>
<%-- Various input fields here --%>
<input id="submit" type="submit" value="Submit" />
<img id="wait" src="../../Content/images/ajax-loader.gif" alt="" style="display: none" />
<% End Using%>

Answer

Josh Stodola picture Josh Stodola · Jan 18, 2010

This problem is happening only in IE, correct? Rick Strahl discussed this on his blog some time back. Be sure to read the comments.

Animated GIF images in hidden page elements