Simple Modal Dialog Example

This page demonstrates how to display a simple modal dialog. The button below will invoke blockUI with a custom message. Depending upon the user response (yes or no) an ajax call will be made while keeping the UI blocked.

The following code is used on this page:

<script type="text/javascript">
$(document).ready(function() { $('#test').click(function() {
$.blockUI({ message: $('#question'), css: { width: '275px' } });
}); $('#yes').click(function() {
// update the block message
$.blockUI({ message: "<h1>Remote call in progress...</h1>" }); $.ajax({
url: 'wait.php',
cache: false,
complete: function() {
// unblock when remote call returns
$.unblockUI();
}
});
}); $('#no').click(function() {
$.unblockUI();
return false;
}); });
</script> ... <input id="test" type="submit" value="Show Dialog" /> ... <div id="question" style="display:none; cursor: default">
<h1>Would you like to contine?.</h1>
<input type="button" id="yes" value="Yes" />
<input type="button" id="no" value="No" />
</div>

For full-featured modal dialog support, check out Simple Modal by Eric Martin or jqModal by Brice Burgess.

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

jQuery BlockUI Plugin Demo 5(Simple Modal Dialog Example)的更多相关文章

  1. jQuery BlockUI Plugin Demo 6(Options)

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

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

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

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

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

  4. jQuery BlockUI Plugin Demo 2

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

  5. jQuery BlockUI Plugin Demo

    1.Login Form $(document).ready(function() { $('#demo1').click(function() { $.blockUI({ message: $('# ...

  6. jquery.ui.accordion的修改(支持展开多个)

    原文:jquery.ui.accordion的修改(支持展开多个) 背景:原jquery.ui.accordion插件,最多只能展开一个,不能展开多个,后来在网上找到了一个基于它的一个修改版(http ...

  7. Jquery实现数据双向绑定(赋值和取值),类似AngularJS

    <!DOCTYPE html> <html> <head> <meta name="viewport" content="wid ...

  8. PHP设计模式(一)简单工厂模式 (Simple Factory For PHP)

    最近天气变化无常,身为程序猿的寡人!~终究难耐天气的挑战,病倒了,果然,程序猿还需多保养自己的身体,有句话这么说:一生只有两件事能报复你:不够努力的辜负和过度消耗身体的后患.话不多说,开始吧. 一.什 ...

  9. jQuery 滚动条 滚动到底部(下拉到底部) 加载数据(触发事件、处理逻辑)、分页加载数据

    1.针对浏览器整个窗口滚动 主要代码: <script type="text/javascript"> ; function GetProductListPageFun ...

随机推荐

  1. git将一个分支的内容替换为另一分支内容

    假设我想将我的linux分支内容替换master分支的内容. # 切换到master分支 git checkout master # 再将本地的master分支重置成linux git reset - ...

  2. require sqlite3时报The specified module could not be found.错误

    http://dependencywalker.com/ 在这个站点下载对应平台的Dependency Walker,打开你自己编译好的.node文件(sqlite3\lib\binding\node ...

  3. ES6学习记录(一)

    Class类 Class的静态方法 类相当于实例的原型,所有在类中定义的方法,都会被实例继承.如果在一个方法前,加上static关键字,就表示该方法不会被实例继承,而是直接通过类来调用,这就称为“静态 ...

  4. IE下iframe不能正常加载,显示空白

    下午帮忙看了一个web问题,index.html中嵌入<iframe>来加载同文件目录下的一个页面,在多个浏览器下测试,发现IE浏览器中会出现问题,<iframe>不能正常加载 ...

  5. 使用这些 CSS 属性选择器来提高前端开发效率

    属性选择器非常神奇.它们可以使你摆脱棘手的问题,帮助你避免添加类,并指出代码中的一些问题.但是不要担心,虽然属性选择器非常复杂和强大,但是它们很容易学习和使用.在本文中,我们将讨论它们是如何运行的,并 ...

  6. sudo 命令报 unable to resolve host 导致反应速度变慢

    1 分析 1.1 字面分析,不能解析主机 1.2 由于修改了本地主机名称所导致 2 解决 2.1 打开 /etc/hosts 2.2 主机名称指向,如你的主机名为 debian 2.3  127.0. ...

  7. MongoDB 分片管理(四)数据均衡 -- 特大快

    1.1 特大快形成 如果用date字段作为片键,集合中date是一个日期字符串,如:year/month/day,也就是说,mongoDB一天创建一个块.因块内所有文档的片键一样,因此这些块是不可拆分 ...

  8. Postgresql 物理备份冷备份 与 热备份

    一.冷备份 将数据库停下来,然后把数据库的PGDATA目录拷贝下来就可以了. PostgreSQL把与数据库实例有关的配置文件和数据文件都放在PGDATA目录下,所以做冷备份很简单. 二.热备份 热备 ...

  9. jenkins之docker安装(jenkins/jenkins:lts)

    建议使用此镜像安装,不要使用官网推荐的jenkinsci/blueocean镜像,使用它构建node程序会出现问题. 1.宿主服务器jenkins_home目录权限 为了方便安装插件,升级,迁移,因此 ...

  10. Android Studio如何删除一个Module

    当你想在Android Studio中删除某个module时,大家习惯性的做法都是选中要删除的module,右键去找delete.但是在Android  Studio中你选中module,右键会发现没 ...