zoukankan      html  css  js  c++  java
  • CSS3的颜色透明度 ajax请求时loading

    1.background-color:rgba(0,0,0,0.65)         这行代码让覆盖层变黑色,且有0.6的透明度

    正常情况下遮盖层会把透明度遗传给弹出框(它的子元素),但是利用CSS3的这个特性则不会

    2.

    在ajax方法中定义任意位置显示的“加载中。。。”提示

    $('#ajax_test2').click(function(){
         $.ajax({
              url ---- url路径,根据你需要些啦,
              type:'post',
              data:'name=ZXCVB',
              timeout:15000,
              beforeSend:function(XMLHttpRequest){
                  //alert('远程调用开始...');
                  $("#loading").html.("<img src='/jqueryStu/images/loading.gif' />");
             },
             success:function(data,textStatus){
                 alert('开始回调,状态文本值:'+textStatus+' 返回数据:'+data);
                 // $("#loading").empty();
               },
              complete:function(XMLHttpRequest,textStatus){
                  // alert('远程调用成功,状态文本值:'+textStatus);
                 $("#loading").empty();
               },
               error:function(XMLHttpRequest,textStatus,errorThrown){
                  alert('error...状态文本值:'+textStatus+" 异常信息:"+errorThrown);
                 $("#loading").empty();
              }
           });
        });

    < input type.="button" id="ajax_test2" value="Ajax方式">
      <div id="loading"></div>

    很明显,在beforeSend时,在指定的位置显示“加载中。。。”图标,在error、complete、success后把该图标移除掉!!!!

  • 相关阅读:
    93.快速搭建Web环境 Angularjs + Express3 + Bootstrap3
    92.bower 需要git
    91.Bower : ENOGIT git is not installed or not in the PATH 解决方法
    5.Git使用详细教程
    4.git "Could not read from remote repository.Please make sure you have the correct access rights."解决方案
    2.windows下安装git
    Git常用命令
    每天一个linux命令(50):crontab命令
    crontab 不能执行git命令问题备忘
    Git PHP提交
  • 原文地址:https://www.cnblogs.com/xisitan/p/4636041.html
Copyright © 2011-2022 走看看