1.Login Form

$(document).ready(function() {
$('#demo1').click(function() {
$.blockUI({ message: $('#loginForm') }); setTimeout($.unblockUI, 2000);
});
});

2.iPhoto (ish)

$(document).ready(function() {
$('#demo2').click(function() {
$.blockUI({ css: {
border: 'none',
padding: '15px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .5,
color: '#fff'
} }); setTimeout($.unblockUI, 2000);
});
});

3.Blue Overlay

$(document).ready(function() {
$('#demo3').click(function() {
$.blockUI({ overlayCSS: { backgroundColor: '#00f' } }); setTimeout($.unblockUI, 2000);
});
});

4.Tall Content

$(document).ready(function() {
$('#demo4').click(function() {
$.blockUI({
message: $('#tallContent'),
css: { top: '20%' }
}); setTimeout($.unblockUI, 2000);
});
});

5.Image Box

$(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);
});
});

6.Non-centered message

$(document).ready(function() {
$('#demo6').click(function() {
$.blockUI({
centerY: 0,
css: { top: '10px', left: '', right: '10px' }
}); setTimeout($.unblockUI, 2000);
});
});

7.Blocking without a message (pass null as message)

$(document).ready(function() {
$('#demo7').click(function() {
$.blockUI({ message: null }); setTimeout($.unblockUI, 2000);
});
});

8.onUnblock callback (useful when using fadeOut option as it is invoked when all the blocking elements have been removed)

$(document).ready(function() {
$('#demo8').click(function() {
$.blockUI(); setTimeout(function() {
$.unblockUI({
onUnblock: function(){ alert('onUnblock'); }
});
}, 2000);
});
});

9.Click overlay to unblock (This demo will not automatically unblock, you must click the overlay.)

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

10.Auto-Unblock Sets a timer to unblock after a specified timeout.

$(document).ready(function() {
$('#demo10').click(function() {
$.blockUI({
message: '<h1>Auto-Unblock!</h1>',
timeout: 2000
});
});
});

11.Growl (the hard way)

$(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'
}
});
});
});

12.Growl (the easy way)

$(document).ready(function() {
$('#demo12').click(function() {
$.growlUI('Growl Notification', 'Have a nice day!');
});
});

The two growl examples above also make use of the following external CSS:

div.growlUI { background: url(check48.png) no-repeat 10px 10px }
div.growlUI h1, div.growlUI h2 {
color: white; padding: 5px 5px 5px 75px; text-align: left
}

Note: For a more full-featured "growl" implementation, check out the excellent jGrowl plugin by Stan Lemon.

13.jQuery UI Theme. Use jQuery UI themes to style the messaege

$(document).ready(function() {
$('#demo13').click(function() {
$.blockUI({
theme: true,
title: 'This is your title',
message: '<p>This is your message.</p>',
timeout: 2000
});
});
});

14.onBlock callback

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

15.onOverlayClick callback

//Click overlay to unblock.
$(document).ready(function() {
$('#demo15').click(function() {
$.blockUI({
onOverlayClick: $.unblockUI
});
});
});

参考:http://malsup.com/jquery/block/#overview

jQuery BlockUI Plugin Demo的更多相关文章

  1. jQuery BlockUI Plugin Demo 2

    Overview The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without l ...

  2. jQuery BlockUI Plugin Demo 6(Options)

    Options BlockUI's default options look (exactly) like this: // override these in your code to change ...

  3. jQuery BlockUI Plugin Demo 5(Simple Modal Dialog Example)

    Simple Modal Dialog Example This page demonstrates how to display a simple modal dialog. The button ...

  4. jQuery BlockUI Plugin Demo 3(Page Blocking Examples)

    This page demonstrates several ways to block the page. Each button below activates blockUI and then ...

  5. jQuery BlockUI Plugin Demo 4(Element Blocking Examples)

    Element Blocking Examples This page demonstrates how to block selected elements on the page rather t ...

  6. jQuery Validation Plugin学习

    http://blog.csdn.net/violet_day/article/details/14109261 jQuery Validation Plugin Demo 一.默认校验规则 (1)r ...

  7. JQuery多媒体插件jQuery Media Plugin使用详解

    malsup jquery media plugin 该插件可以播放多种类型的多媒体文件包括:Flash, Quicktime, Windows Media Player, Real Player, ...

  8. (转)jQuery Validation Plugin客户端表单证验插件

    jQuery Validation Plugin客户端表单验证插件 官方文档:http://jqueryvalidation.org/documentation/ 官方demo:http://jque ...

  9. jQuery多媒体播放器插件jQuery Media Plugin使用方法

    jQuery Media Plugin是一款基于jQuery的网页媒体播放器插件,它支持大部分的网络多媒体播放器和多媒体格式,比如:Flash, Windows Media Player, Real ...

随机推荐

  1. centos 下 sphinx安装和配置

    一.安装前提必备先安装工具 yum -y install make gcc g++ gcc-c++ libtool autoconf automake imake mysql-devel libxml ...

  2. css 学习笔记 菜鸟

    1 CSS 规则由两个主要的部分构成:选择器,以及一条或多条声明: 选择器通常是您需要改变样式的 HTML 元素. 每条声明由一个属性和一个值组成.每个属性有一个值.属性和值被冒号分开.CSS声明总是 ...

  3. python 单引号与双引号的转义

    import simplejson a = """{"a":"\\""}""" b = & ...

  4. fiddler修改请求和返回

    一.修改请求 1.先设置请求前断点 2.设置拦截,在左下角的QuickExec命令行中输入bpu www.baidu.com/XXXX 3.选中需要修改的请求,选中Inspectors面板,使用Raw ...

  5. Liunx使用

    进入文件后的操作 1. vi打开文件后是命令模式状态,要用i或者a命令才可进入可编辑的状态哟. 2.在编辑模式的情况下敲完内容,这个时候就应该保存文件了. 保存文件要按esc,这样就会退回vi的命令模 ...

  6. Mysql开启慢查询命令

    ; 查询: SHOW VARIABLES LIKE '%slow_query_log%'; 结果:

  7. HTML 文字前面怎么加空格

    HTML  写文字开头需要用空格时  就需要在文字前面     使用时两个 为一个字的距离 使用后

  8. java重载和重写

    重载(Overloading) (1) 方法重载是让类以统一的方式处理不同类型数据的一种手段.多个同名函数同时存在,具有不同的参数个数/类型. 重载Overloading是一个类中多态性的一种表现. ...

  9. QT项目之创建.pri文件

    做大项目的时候,有很多.h和.cpp文件,会很繁琐.就需要.pri文件夹,将大项目分解成一个个的子项目,方便理清思绪和后期维护. 废话不多说,直接上过程! 第一步:新建一个项目.如图,选择choose ...

  10. Elasticsearch 索引文档的增删改查

    利用Elasticsearch-head可以在界面上(http://127.0.0.1:9100/)对索引进行增删改查 1.RESTful接口使用方法 为了方便直观我们使用Head插件提供的接口进行演 ...