Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ab(load) {
- l = load;
- $('body').append('<div id="overlay" />');
- $('#overlay').fadeIn(300, function() {
- $('body').append('<div id="alertModalOuter"><div id="alertModal"></div></div>');
- var outer = $('#alertModalOuter');
- var modal = $('#alertModal');
- var defWidth = outer.outerWidth();
- var defHeight = outer.outerHeight();
- modal.load('alert.html' + ' #alert', function() {
- var alertBoxContent = $('#alert');
- var alertWidth = alertBoxContent.outerWidth();
- var alertHeight = alertBoxContent.outerHeight();
- var widthCombine = -((defWidth + alertWidth) / 2);
- var heightCombine = -((defHeight + alertHeight) / 2);
- modal.animate({width: alertWidth, height: alertHeight}, 200);
- outer.animate({marginLeft: widthCombine, marginTop: heightCombine}, 200, function() {
- alertBoxContent.fadeIn(200, function() {
- $('#yes').click(function(e) {
- e.preventDefault();
- window.location.href = l;
- });
- $('#no').click(function(e) {
- e.preventDefault();
- $('#overlay, #alertModalOuter').fadeOut(400, function() {
- $(this).remove();
- });
- });
- });
- });
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement