This repository was archived by the owner on Mar 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
This repository was archived by the owner on Mar 19, 2020. It is now read-only.
Resize problem. #2
Copy link
Copy link
Open
Description
There is a problem with resize, because is beaking other code/freamworks. I have changed rhis two functions, show and hide, take a look:
function show() {
if (isShown) {
return;
}
divMsgBox.css({ opacity: 0, top: top - 50, left: left });
divMsgBox.css("background-image", "url('"+msgBoxImagePath+"msgBoxBackGround.png')");
divMsgBoxBackGround.css({ opacity: options.opacity });
options.beforeShow();
divMsgBoxBackGround.css({ "width": $(document).width(), "height": getDocHeight() });
$(divMsgBoxId+","+divMsgBoxBackGroundId).fadeIn(0);
divMsgBox.animate({ opacity: 1, "top": top, "left": left }, 200);
setTimeout(options.afterShow, 200);
$("#" + firstButtonId).focus();
isShown = true;
$(window).resize(resizer);
}
function resizer(e) {
var width = divMsgBox.width();
var height = divMsgBox.height();
var windowHeight = $(window).height();
var windowWidth = $(window).width();
var top = windowHeight / 2 - height / 2;
var left = windowWidth / 2 - width / 2;
divMsgBox.css({ "top": top, "left": left });
divMsgBoxBackGround.css({"width": "100%", "height": "100%"});
}
function hide() {
if (!isShown) {
return;
}
options.beforeClose();
divMsgBox.animate({ opacity: 0, "top": top - 50, "left": left }, 200);
divMsgBoxBackGround.fadeOut(300);
setTimeout(function () { divMsgBox.remove(); divMsgBoxBackGround.remove(); }, 300);
setTimeout(options.afterClose, 300);
//$(window).unbind("resize");
$(window).off("resize", resizer);
isShown = false;
}
Metadata
Metadata
Assignees
Labels
No labels