jQuery BlockUI Plugin Last Updated : 10 Jul, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The BlockUI plugin is used to simulate synchronous AJAX behavior. When activated, it stops the user from interacting with the page until it is deactivated. The DOM (Document Object Model) is added with elements to give a nice user-interface look and feel along with behavior. Download Link: <script src="https://malsup.github.io/jquery.blockUI.js"></script> Syntax: For blocking the UI $.blockUI(); For unblocking the UI $.unblockUI(); When we call blockUI without parameters, it displays a "Please wait" message on the screen. We can change the messages by adding parameters to it. To block only an element and not the whole page, we have to make a slightly different call, block and unblock. To get a better understanding, let us see a basic example. Example: html <!DOCTYPE html> <html> <head> <title>BlockUI</title> <script src= "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script src= "https://malsup.github.io/jquery.blockUI.js"> </script> <style> .btn { background-color: white; color: black; padding: 14px 28px; font-size: 16px; cursor: pointer; margin-bottom: 3rem; } .success { border-color: #4CAF50; color: green; } .success:hover { background-color: #4CAF50; color: white; } </style> </head> <body> <button class="btn success" id="blockd"> BlockUI default</button> <br> <button class="btn success" id="blockm"> BlockUI with custom message</button> <br> <button class="btn success" id="blocks"> BlockUI with custom style </button> <div id="blockel"> <button class="btn success" id="blocke"> BlockUI Element Blocking</button> </div> <div id="message" style="display: none;"> <h1>Loading ...</h1> </div> <script> $(document).ready(function () { $("#blockd").click(function () { // Default blockUI code $.blockUI(); setTimeout(function () { // Timer to unblock $.unblockUI(); }, 3000); }); $("#blockm").click(function () { // blockUI code with custom message $.blockUI({ message: $('#message') }); setTimeout(function () { $.unblockUI(); }, 3000); }); $("#blocks").click(function () { $.blockUI({ // blockUI code with custom // message and styling message: "<h3>GeeksForGeeks loading...<h3>", css: { color: 'green', borderColor: 'green' } }); setTimeout(function () { $.unblockUI(); }, 3000); }); $("#blocke").click(function () { $("#blockel").block({ // BlockUI code for element blocking message: "<h3>GeeksForGeeks loading...<h3>", css: { color: 'green', borderColor: 'green' } }); setTimeout(function () { $("#blockel").unblock(); }, 3000); }); }); </script> </body> </html> Output: Before BlockUI activated: After BlockUI activated: Default BlockUI: BlockUI with custom message: BlockUI with custom styling: BlockUI Element Blocking: Comment More infoAdvertise with us Next Article jQuery UI Introduction S sayaliparulekar Follow Improve Article Tags : Web Technologies JQuery jQuery-UI jQuery-Plugin Similar Reads jQuery Blockrain.js Plugin jQuery plugins enhance an application with features that would generally take a long time to program correctly. However, some plugins are useful in providing entertainment to users. Although many professional sites may not need these, it is a fun feature to include in personal blogs and websites. Bl 3 min read jQuery Plugins Introduction Plugins are the section of code and these codes are written in a JavaScript file. These JavaScript files are used to provide jQuery methods that work together with jQuery library methods. You can download jQuery plug-in from https://jquery.com/plugins How to create a jQuery plugin with methods: In J 2 min read JQueryUI | dialog The Dialog box is the way to inform the user about something. It is a nice way to popup on the user window to show the information that will happen in the next or any kind of information developer wants to clarify to the user should know. jQueryUI dialog method is used to create a basic dialog windo 2 min read jQuery UI jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether youâre building highly interactive web applications, or you just need to add a date picker to a form control, jQuery UI is a perfect choice. This JavaScript 3 min read jQuery UI Introduction jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications, or you just need to add a date picker to a form control, jQuery UI is the perfect choice. Features: jQue 2 min read jQuery Plugins Complete Reference Plugins are the section of code and these codes are written in a JavaScript file. These JavaScript files are used to provide jQuery methods that work together with jQuery library methods. jQuery Plugins Complete List: Plugins Description Page Piling This feature provides Pile your sections one over 2 min read Like