Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用JQuery加载动画的Gridview是一个静止帧,即不设置动画_Javascript_Jquery_Button_Gridview_Loading - Fatal编程技术网

Javascript 使用JQuery加载动画的Gridview是一个静止帧,即不设置动画

Javascript 使用JQuery加载动画的Gridview是一个静止帧,即不设置动画,javascript,jquery,button,gridview,loading,Javascript,Jquery,Button,Gridview,Loading,您好,谢谢您的关注 在我之前的项目中,当我忙于创建数据以绑定Gridview时,我使用UpdatePanel显示加载程序gif。我想将这部分代码移到JQuery上,所以在查看此解决方案后,我用链接到gif的img标记替换了UpdatePanel () 在我的index.html页面中 <script> $(document).ready(function () { $('#loadingImage').hide();

您好,谢谢您的关注

在我之前的项目中,当我忙于创建数据以绑定Gridview时,我使用UpdatePanel显示加载程序gif。我想将这部分代码移到JQuery上,所以在查看此解决方案后,我用链接到gif的img标记替换了UpdatePanel ()

在我的index.html页面中

        <script>

        $(document).ready(function () {
            $('#loadingImage').hide();
        });

        function ShowLoaderImage() {
            $('#loadingImage').show();
        }
    </script>

$(文档).ready(函数(){
$(“#加载图像”).hide();
});
函数ShowLoaderImage(){
$(“#加载图像”).show();
}
我从asp:按钮调用了ShowLoaderImage,该按钮用于填充Gridview的源代码

<asp:Button ID="View_Data_Button" CssClass="dataButton" OnClick="View_Data_Button_Click" OnClientClick="ShowLoaderImage()" runat="server" Text="View Data" />


我希望当我点击按钮加载GridView时图像开始旋转,当加载GridView时图像消失,因为document.ready也会出现。相反,我看到的是一个冻结的gif帧——并没有动画。如何修复此问题?

我建议替换元素中的html

        $('#data_loding_div').html('<img  alt="loadingImage" src="/images/loadingImage.gif" />')
 $('#data_loding_div').html(data);