首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >动画GIF在IE中停止,但在FF和Chrome中可用

动画GIF在IE中停止,但在FF和Chrome中可用
EN

Stack Overflow用户
提问于 2015-03-02 18:00:54
回答 1查看 1.5K关注 0票数 1

我试图显示动画动图点击按钮,但它是冻结在IE (8,9),在IE11,FF和铬。

是否有任何解决方法。

这是html代码;

代码语言:javascript
复制
   <!DOCTYPE html>

        <html xmlns="http://www.w3.org/1999/xhtml">
        <head runat="server">


        <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/start/jquery-ui.css" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
            <title></title>

            <style type="text/css">

            .cssbox-progress { 
            background-image: url('images/3.gif'); 
            background-repeat: no-repeat;  
            }

            .loading
            {
                width: 50px;
                height: 10px;
                 display: none;
                background-color: White;                  
            }

        </style>

        <script >
            function ShowProgress() {
                setTimeout(function () {

                    var loading = $(".loading");
                    loading.show();
                }, 200);
            }
            function test() {
                ShowProgress();
            }

        </script>

        </head>
        <body>
            <form id="form1" runat="server">
                 <div class="loading" align="center" style="width: 50px; height: 10px; ">

                <div class="cssbox-progress" style="width: 50px; height: 10px;"></div>

                </div>

      <asp:Button ID="btn" runat="server" Text="Login" onclientclick ="test()"  />


            </form>
        </body>
        </html>

动画GIF

EN

回答 1

Stack Overflow用户

发布于 2015-03-02 19:02:49

作为对评论的回应,这里是这样的场景: 1-你需要显示一个“加载”的动画gif。2- gif在IE8/9.3中不是动画。3-你需要在css中更改源代码,因为你使用的是主题。

答案是

代码语言:javascript
复制
<style>
.cssbox-progress { 
     content: url('http://i.stack.imgur.com/dS784.gif'); 
}
</style>

代码语言:javascript
复制
<img class="cssbox-progress" />

我没有在IE8/9上测试它,我使用一个插件来测试它可能的样子,但你应该测试它以确保。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28806950

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档