lavkach3
1$(function () {2$(".block-card").on("click", function () {3var block_ele = $(this).closest(".card");4$(block_ele).block({5message: '<i class="ti ti-refresh text-white fs-5"></i>',6timeout: 2000, //unblock after 2 seconds7overlayCSS: {8backgroundColor: "#000",9opacity: 0.5,10cursor: "wait",11},12css: {13border: 0,14padding: 0,15backgroundColor: "transparent",16},17});18});19
20// Block sidebar21$(".block-sidenav").on("click", function () {22var block_ele = $(".side-mini-panel");23$(block_ele).block({24message: '<i class="ti ti-refresh text-white fs-5"></i>',25timeout: 2000, //unblock after 2 seconds26overlayCSS: {27backgroundColor: "#000",28opacity: 0.5,29cursor: "wait",30},31css: {32border: 0,33padding: 0,34backgroundColor: "transparent",35},36});37});38
39// Block page40$(".block-default").on("click", function () {41$.blockUI({42message: '<i class="ti ti-refresh text-white fs-5"></i>',43timeout: 2000, //unblock after 2 seconds44overlayCSS: {45backgroundColor: "#000",46opacity: 0.5,47cursor: "wait",48},49css: {50border: 0,51padding: 0,52backgroundColor: "transparent",53},54});55});56
57// onBlock callback58$(".onblock").on("click", function () {59$.blockUI({60message: '<i class="ti ti-refresh text-white fs-5"></i>',61fadeIn: 1000,62timeout: 2000, //unblock after 2 seconds63overlayCSS: {64backgroundColor: "#000",65opacity: 0.5,66cursor: "wait",67},68css: {69border: 0,70padding: 0,71color: "#333",72backgroundColor: "transparent",73},74onBlock: function () {75alert("Page blocked!");76},77});78});79
80// onUnblock callback81$(".onunblock").on("click", function () {82$.blockUI({83message: '<i class="ti ti-refresh text-white fs-5"></i>',84timeout: 2000, //unblock after 2 seconds85overlayCSS: {86backgroundColor: "#000",87opacity: 0.5,88cursor: "wait",89},90css: {91border: 0,92padding: 0,93color: "#333",94backgroundColor: "transparent",95},96onUnblock: function () {97alert("Page unblocked!");98},99});100});101
102// Overlay callback103$(".onoverlay-click").on("click", function () {104$.blockUI({105message: '<i class="ti ti-refresh text-white fs-5"></i>',106overlayCSS: {107backgroundColor: "#000",108opacity: 0.5,109cursor: "wait",110},111css: {112color: "#333",113border: 0,114padding: 0,115backgroundColor: "transparent",116},117onOverlayClick: $.unblockUI,118});119});120
121// Block Without Message122$(".without-msg").on("click", function () {123var block_ele = $(this).closest(".card");124$(block_ele).block({125message: null,126timeout: 2000, //unblock after 2 seconds127overlayCSS: {128backgroundColor: "#000",129opacity: 0.5,130cursor: "wait",131},132css: {133border: 0,134padding: 0,135backgroundColor: "transparent",136},137});138});139
140// Block without overlay141$(".without-overlay").on("click", function () {142var block_ele = $(this).closest(".card");143$(block_ele).block({144message: '<i class="ti ti-refresh text-white fs-5"></i>',145showOverlay: false,146timeout: 2000, //unblock after 2 seconds147css: {148width: 50,149height: 50,150lineHeight: 1,151color: "#fff",152border: 0,153padding: 15,154backgroundColor: "#000",155},156});157});158
159// Unblock on overlay click160$(".overlay-unblock").on("click", function () {161var block_ele = $(this).closest(".card");162$(block_ele).block({163message: '<i class="ti ti-refresh text-white fs-5"></i>',164overlayCSS: {165backgroundColor: "#000",166opacity: 0.5,167cursor: "wait",168},169css: {170border: 0,171padding: 0,172backgroundColor: "transparent",173},174});175
176$(".blockOverlay").on("click", function () {177$(block_ele).unblock();178});179});180
181// Growl notification182$(".growl").on("click", function () {183$.blockUI({184message: $(".growl-notification-example"),185fadeIn: 700,186fadeOut: 700,187timeout: 3000,188showOverlay: false,189centerY: false,190css: {191width: "250px",192top: "20px",193left: "",194right: "20px",195border: "none",196padding: "15px 5px",197backgroundColor: "#000",198"-webkit-border-radius": "10px",199"-moz-border-radius": "10px",200opacity: 0.9,201color: "#fff",202},203});204});205});206