Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 31st, 2012  |  syntax: None  |  size: 0.79 KB  |  views: 29  |  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. $(document).ready(function () {
  2.  
  3.     $('.windowClass').click(function () { // <-- bind to all window elements with that class
  4.         $.blockUI({
  5.             message: $('#' + this.id + '_win'),
  6.             css: {
  7.                 top:  ($(window).height() - 40) /2 + 'px',
  8.                 left: ($(window).width() - 200) /2 + 'px',
  9.                 width: '200px',
  10.                 height: '40px'
  11.             }
  12.         });
  13.     });
  14.  
  15.     $('[id$=_close]').click(function () { //<-- gets all elements with id's that end with close
  16.         $.unblockUI();
  17.         return false;
  18.     });
  19. });
  20. $(window).on('resize', function () {
  21.     $('body').children('.blockMsg').css({
  22.         top  : ($(window).height() - 40) /2 + 'px',
  23.         left : ($(window).width() - 200) /2 + 'px'
  24.     });
  25. });​
clone this paste RAW Paste Data