Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ab(page) {
  2.  
  3.     p = page;
  4.  
  5.     $('body').append('<div id="overlay" />');
  6.     $('#overlay').fadeIn(300, function() {
  7.         $('body').append('<div id="alertModalOuter"><div id="alertModal"></div></div>');
  8.         var outer = $('#alertModalOuter');
  9.         var modal = $('#alertModal');
  10.         var defWidth = outer.outerWidth();
  11.         var defHeight = outer.outerHeight();
  12.         modal.load(p + ' #alert', function() {
  13.        
  14.             var alertBoxContent = $('#alert');
  15.            
  16.             var alertWidth = alertBoxContent.outerWidth();
  17.             var alertHeight = alertBoxContent.outerHeight();
  18.            
  19.             var widthCombine = -((defWidth + alertWidth) / 2);
  20.             var heightCombine = -((defHeight + alertHeight) / 2);
  21.  
  22.             modal.animate({width: alertWidth, height: alertHeight}, 200);
  23.             outer.animate({marginLeft: widthCombine, marginTop: heightCombine}, 200, function() {
  24.                 alertBoxContent.fadeIn(200, function() {
  25.                     $('#yes').click(function(e) {
  26.                         e.preventDefault();
  27.                         $('#overlay, #alertModalOuter').fadeOut(400, function() {
  28.                             $(this).remove();
  29.                         });
  30.                     });
  31.                 });
  32.             });
  33.  
  34.         });
  35.     });
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement