Jquery Blockui Usage

Source: Internet
Author: User

1 Examples of locked pages

<Scripttype= "Text/javascript">    //unblock when Ajax activity stops$ (). Ajaxstop ($.unblockui); functionTest () {$.ajax ({URL:'wait.php', Cache:false }); } $ (document). Ready (function() {        $('#pageDemo1'). Click (function() {$.blockui ();        Test ();        }); $('#pageDemo2'). Click (function() {$.blockui ({message:'' });        Test ();        }); $('#pageDemo3'). Click (function() {$.blockui ({css: {backgroundcolor:'#f00', Color:'#fff' } });        Test ();        }); $('#pageDemo4'). Click (function() {$.blockui ({message: $ ('#domMessage') });        Test ();    }); });</Script>...<DivID= "Dommessage"style= "Display:none;">    <H1>Processing, please wait ...</H1></Div>

------------------------------------------------------------------------------------
2 Examples of locking elements
This shows how to lock the elements in the page, not the entire page. Please click the Block/unblock button to see the effect.

<Scripttype= "Text/javascript">    $(function() {        $('#blockButton'). Click (function() {            $('div.test'). Block ({message:NULL });        }); $('#blockButton2'). Click (function() {            $('div.test'). Block ({message:'', CSS: {border:'3px Solid #a00' }             });        }); $('#unblockButton'). Click (function() {            $('div.test'). unblock ();        }); $('a.test'). Click (function() {alert ('Link Clicked'); return false;    }); });</Script>

------------------------------------------------------------------------------------
3 Simple dialog Box example
This page shows how to display a simple simulation dialog box. The following buttons activate the display of a blockUI custom message. This AJAX request will be sent or canceled according to the user's response (yes or no) and will remain locked for the duration of the user's decision.

<Scripttype= "Text/javascript">    $(function() {        $('#test'). Click (function() {$.blockui ({message: $ ('#question'), CSS: {width:'275px' } });        }); $('#yes'). Click (function() {            //Update the block message$.blockui ({message:"" }); $.ajax ({URL:'wait.php', Cache:false, Complete:function() {                    //unblock when remote call returns$.unblockui ();        }            });        }); $('#no'). Click ($.unblockui); });</Script>...<inputID= "Test"type= "Submit"value= "Show dialog box" />...<DivID= "question"style= "Display:none; Cursor:default">        <H1>Are you sure you want to continue?</H1>        <inputtype= "button"ID= "Confirm"value= "Yes" />        <inputtype= "button"ID= "Cancel"value= "No" /></Div>



Jquery Blockui Usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.