Welcome to WebmasterWorld Guest from 54.196.208.6

Forum Moderators: open

Message Too Old, No Replies

Animated gif problem in IE and Chrome

     
8:37 am on Apr 23, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:Jan 21, 2009
posts: 69
votes: 0


Hi,

I have an HTML form used for uploading large files. On submit, I'm displaying an animated gif till the form is submitted (no ajax used). The gif shows up in place, but the animation neither works in IE nor in Chrome - only in FF.

This is how it looks:



<script>

$(document).ready(function () {

$("#submit_button").click(function (e) {

$('body').prepend('<div align="center">
<img id="loader" src="loader.gif" height="250"width="300" /></div>');
$("#loader").load(function () {
$('form').submit();
});

});

});
</script>

<body>

<form action="/path/to/submit" method="post" enctype="multipart/form-data">
<input type="file" name="user_file" />
<input type="button" id="submit_button" />
</form>

</body>



Is there any solution to this?

Thanks.
3:03 am on Apr 24, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 31, 2005
posts:1108
votes: 0


What happens if you have the .gif file in the page using a straight HTML img tag without the script?