Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 17th, 2012  |  syntax: None  |  size: 1.05 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Get the source of the event from delegate when it's on document
  2. $(document).ready(function() {
  3.                 $(document).delegate("", "ajaxStart", function(event) {
  4.                     console.log(event);
  5.  
  6.                     $.blockUI({
  7.                         message: "<h1 style='color: #000'>Loading ...</h1>",
  8.                         overlayCSS: {
  9.                             backgroundColor: '#000',
  10.                             opacity: .1
  11.                         },
  12.                         css: {
  13.                             border: '2px solid #000',
  14.                             padding: '15px',
  15.                             backgroundColor: '#fff',
  16.                                             '-webkit-border-radius': '10px',
  17.                                             '-moz-border-radius': '10px',
  18.                             color: '#000'
  19.                         }
  20.                     });
  21.                 });
  22.  
  23.                 $(document).delegate("", "ajaxStop", function(event) {
  24.                     $.unblockUI();
  25.                 });
  26.             });