zoukankan      html  css  js  c++  java
  • jquery blockui 遮罩【转】

    参考 : http://bookshadow.com/weblog/2014/09/26/jquery-blockui-js-introduction/

    blockUI.html

    blockUI.html中的jquery都直接引用自互联网,本地不需要

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>blockUI</title>
    <style type="text/css">
    
    </style>
    <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://malsup.github.io/min/jquery.blockUI.min.js"></script>
    
    <script type="text/javascript">
        $(document).ready(function() {
            
            $('#showDivButton').click(function() {
                //建议使用这种指定div的锁,因为它可以对指定div进行解锁,灵活性在此
                $('#showDiv').block({ message: $("#paying"), css: {  '400px' } });
                //而下面的这种通用div只能有一个锁,比较死板,不过大多数情景一个锁可以已经满足了
              //$.blockUI({ message: $("#paying"), css: {  '400px' ,height:'300px'} });
            });
    
            $('#yes').click(function() {
                // update the block message,再弹个窗
                $.blockUI({ message: "<h1>Remote call in progress...</h1>" });
    
                $.ajax({
                    url: 'http://www.baidu.com',
                    cache: false,
                    complete: function() {
                        // unblock when remote call returns
                        //解锁指定div的锁
                        $('#showDiv').unblock();
                        $.unblockUI();
                    }
                });
            });
    
            $('#no').click(function() {
                //解锁指定div的锁
                $('#showDiv').unblock();
                //$.unblockUI();
                return false;
            });
    
        });
    </script>
    </head>
    <body>
    <div id="showDiv">
    
        <input id="showDivButton" type="button" value="显示遮罩" />
    
    
        <div id ="otherDiv1" style="100%;height:70%;background-color:blue">
            我是一个无关紧要的div
        </div>
        <div id ="showDiv" style="100%;height:70%;background-color:red">
            我是showDiv: paying遮罩的容器
        </div>
        <div id ="otherDiv2" style="100%;height:70%;background-color:blue">
            我也是一个无关紧要的div
        </div>
        <div style="100%;height:50%;background-color:green">
    
            <div id="paying" style="display:none; cursor: default">
                <table width="400" border="10" align="center">
                  <tr bgcolor="#006666">
                    <th height="35" colspan="2"><div align="left" class="STYLE1">等待支付宝支付</div></th>
                  </tr>
                  <tr>
                    <td height="50" colspan="2"><span class="STYLE4">请您在新打开的网上银行页面进行支付,支付完成前请不要关闭窗口</span></td>
                  </tr>
                  <tr>
                    <td width="100" height="50" align="center"><input name="success" type="button" id="yes" value="已完成支付" /></td>
                    <td width="100" height="50" align="center"><input name="fail" type="button" id="no" value="支付遇到问题,关闭" /></td>
                  </tr>
                </table>
            </div>
                
        </div>
    </div>
    </body>
    </html>
    
    
            
  • 相关阅读:
    Ralasafe基于策略模型
    如何让Oracle表字段自动增长
    Oracle中Number类型字段使用.netTiers和CodeSmith问题的解决方案
    GridView的DataFormatString参考
    解决.NET连接Oracle数据库的一些问题(转)
    C# WinForm开发系列 DataGridView
    C# 插件式程序开发
    Oracle中“字符串中的字符大小写敏感处理方法”
    做一个项目,平时都用到哪些工具提高效率(中)
    折腾了这么多年的.NET开发,也只学会了这么几招 软件开发不是生活的全部,但是好的生活全靠它了(转)
  • 原文地址:https://www.cnblogs.com/whatlonelytear/p/6023670.html
Copyright © 2011-2022 走看看