1.点击弹出层以外的区域关闭弹出层

$(document).ready(function() { 
    $('#demo9').click(function() { 
        $.blockUI(); 
        $('.blockOverlay').attr('title','Click to unblock').click($.unblockUI); 
    }); 
});

2.blockUI弹出层定位

$(document).ready(function() { 
    $('#demo5').click(function() { 
        $.blockUI({ 
            message: $('#displayBox'), 
            css: { 
                top:  ($(window).height() - 400) /2 + 'px', 
                left: ($(window).width() - 400) /2 + 'px', 
                width: '400px' 
            } 
        }); 
 
        setTimeout($.unblockUI, 2000); 
    }); 
}); 
3.在关闭blockUI的时候执行某个操作

$(document).ready(function() { 
    $('#demo8').click(function() { 
        $.blockUI(); 
 
        setTimeout(function() { 
            $.unblockUI({ 
                onUnblock: function(){ alert('onUnblock'); } 
            }); 
        }, 2000); 
    }); 
}); 
4.弹出层自动定时,到时间后关闭

$(document).ready(function() { 
    $('#demo10').click(function() { 
        $.blockUI({ 
            message: '<h1>Auto-Unblock!</h1>', 
            timeout: 2000 
        }); 
    }); 
}); 
5.关闭blockUI时有淡出效果

$(document).ready(function() { 
    $('#demo11').click(function() { 
        $.blockUI({ 
            message: $('div.growlUI'), 
            fadeIn: 700, 
            fadeOut: 700, 
            timeout: 2000, 
            showOverlay: false, 
            centerY: false, 
            css: { 
                width: '350px', 
                top: '10px', 
                left: '', 
                right: '10px', 
                border: 'none', 
                padding: '5px', 
                backgroundColor: '#000', 
                '-webkit-border-radius': '10px', 
                '-moz-border-radius': '10px', 
                opacity: .6, 
                color: '#fff' 
            } 
        }); 
    }); 
}); 
6.blockUI淡入,加载完成时执行某个函数

$(document).ready(function() { 
    $('#demo14').click(function() { 
        $.blockUI({ 
            fadeIn: 1000, 
            timeout:   2000, 
            onBlock: function() { 
                alert('Page is now blocked; fadeIn complete'); 
            } 
        }); 
    });    
});

BlokUI的使用的更多相关文章

  1. GIT生成公钥和私钥

    转载至:https://blog.csdn.net/gwz1196281550/article/details/80268200 打开 git bash! git config --global us ...

随机推荐

  1. 中国 省会 地级市 经纬度 city array

    <?php $city_arr = array ( '北京' => array ( 'gis_lng' => '116.405285', 'gis_lat' => '39.90 ...

  2. why-and-howto-calculate-your-events-per-second

    http://eromang.zataz.com/2011/04/12/why-and-howto-calculate-your-events-per-second/

  3. CCTableView 简单样例

    非常像android中的listview #pragma once; #include "cocos2d.h" using namespace cocos2d; //使用CCTab ...

  4. 手把手教你在openshift上搭建wordpress博客(二)

    相同公布于:http://www.longgaming.com/archives/128 推荐前往阅读 这一篇文章主要介绍一些经常使用插件的使用和配置. 下面是我个人安装的一些插件.大家能够依据须要自 ...

  5. HDU 2149-Public Sale(巴什博奕)

    Public Sale Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit  ...

  6. linux多线程示例

    #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <pthread.h& ...

  7. ZOJ3689 Digging(01背包)

    #include <iostream> #include <cstdio> #include<cmath> #include<algorithm> #i ...

  8. 延迟N秒执行某个方法

    [self performSelector:<#(nonnull SEL)#> withObject:<#(nullable id)#> afterDelay:<#(NS ...

  9. Session会话跟踪

    用encodeURL重写URL public class SessionA extends HttpServlet { @Override protected void doGet(HttpServl ...

  10. Problem E: Product

    Problem E: ProductTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 18 Solved: 14[Submit][Status][Web Bo ...