Advertisement
Guest User

Untitled

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