如何使用ajax显示图像正在进行加载 [英] How to show loading is in progress with the image using ajax

查看:85
本文介绍了如何使用ajax显示图像正在进行加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi
我正在使用visual studio 2010 .net framework 3.5。

在我的项目中,我正在导入excel文件,加载需要一些时间。

所以在这一点上,我想要显示一个类似于轮子的东西,显示加载正在进行并使屏幕只读。你可能已经在一些网页中看到过。

所以我想知道如何实现它。

请帮助我这方面

Hi I'm using visual studio 2010 .net framework 3.5.
In my project I'm importing excel file and it will take some time to load.
So at this point I want to show something like a wheel that shows loading is in progress and make the screen read only.you might have seen in some webpages.
so I want to know how to implement that.
Please help me in this regard

推荐答案

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>







.divBackMain
      {
          z-index: 99;
          position: fixed;
          top: 0px;
          left: 0px;
          height: 100%;
          width: 100%;
          background-color: black;
          opacity: 0.4;
      }
      .divLoader
      {
          position: fixed;
          top: 50%;
          left: 50%;
          z-index: 100;
          margin-left: -110px;
          margin-top: -110px;
          width: 220px;
          background-image: url('http://2.bp.blogspot.com/-XTR-_X58BHo/UE-v8fIayII/AAAAAAAACMw/fu8ZxR57xUU/s1600/LoadingGIF.gif');
      }
      #DivLoaderContainer
      {
          display:none;
          }




function UploadData() {


#DivLoaderContainer)。fadeIn(); // 每当ypu想要显示加载程序时设置fadeIn
("#DivLoaderContainer").fadeIn(); //set fadeIn whenever ypu want to show loader


。 ajax({
类型: POST
url: PageName.aspx / MethodName
contentType: application / json; charset = utf-8
data:{}, // 参数
dataType: json
成功:功能(数据){
.ajax({ type: "POST", url: "PageName.aspx/MethodName", contentType: "application/json;charset=utf-8", data: {}, //Parameters dataType: "json", success: function (data) {


这篇关于如何使用ajax显示图像正在进行加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆