[英]Jquery html() and Internet Explorer Issue
The JS script: JS脚本:
function ShowUploadingAnimation()
{
$('#info_msg').html("<div style=\"padding-top: 15px; height: 50px;\" align=\"center\"><img id=\"uploading-img\" /></div>");
$("#uploading-img").attr({ src: "images/uploading.gif", alt: "Uploading" });
}
And the html usage: 和html用法:
<input type="submit" value="Upload" onclick="ShowUploadingAnimation();">
<div id="info_msg"></div>
So my issue is the following: This method works ok in Firefox, but in Internet Explorer the gif file is loaded, but it's not animated, just static... showing only a random frame each time the button is clicked. 因此,我的问题如下:该方法在Firefox中行之有效,但是在Internet Explorer中加载了gif文件,但它不是动画的,只是静态的……每次单击按钮时,仅显示随机帧。 Any suggestions?
有什么建议么?
This is a well known issue with ie and animated gif's when showing/hiding images whilst during xhr calls & file uploads. 在xhr通话和文件上传期间显示/隐藏图像时,这是ie和gif动画的一个众所周知的问题。 There are lots of solutions given here on a Ricks Strahl blog post in the comments.
Ricks Strahl博客中的评论中提供了许多解决方案。 Maybe one of them will work for you.
也许其中之一会为您工作。
Easy trick would be put this into iframe. 简单的技巧就可以将其放入iframe。 Instead of <img src=''> use <iframe src=''></iframe>.
代替<img src =''>,使用<iframe src =''> </ iframe>。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.