码迷,mamicode.com
首页 > Web开发 > 详细

jQuery BlockUI Plugin Demo 2

时间:2015-02-02 15:31:45      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

 Overview

The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAXwithout locking the browser[1]. When activated, it will prevent user activity with the page (or part of the page) until it is deactivated. BlockUI adds elements to the DOM to give it both the appearance and behavior of blocking user interaction.

//Usage is very simple; to block user activity for the page:
$.blockUI();

//Blocking with a custom message:
$.blockUI({ message: ‘<h1><img src="busy.gif" /> Just a moment...</h1>‘ });

//Blocking with custom style:
$.blockUI({ css: { backgroundColor: ‘#f00‘, color: ‘#fff‘} });

//To unblock the page:
$.unblockUI();

//If you want to use the default settings and have the UI blocked for all ajax requests, it‘s as easy as this:
$(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);

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

jQuery BlockUI Plugin Demo 2

标签:

原文地址:http://www.cnblogs.com/wolfocme110/p/4267671.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!