To avoid dropdowns and iframes shown above modal pop up
JS
function pageLoad() {
var bid = [];
jQuery.each(bid, function () {
try {
var val = this;
modalbehavior = $find(this);
//Add the functions to handle the
ModalPopupExtender's 'Shown'/'Hidden' event.
modalbehavior.add_shown(mpeShown);
modalbehavior.add_hiding(mpeHidden);
} catch (err) { //do nothing }
});
}
function mpeShown() {
//If the browser is IE6, add a iframe into the modal
panel.
document.documentElement.style.overflow = 'hidden';
if (Sys.Browser.name == "Microsoft
Internet Explorer" && Sys.Browser.version < 7) {
$('li').hide();
$('select').hide();
for (var
i = 0; i < window.frames.length; i++) {
var doc = window.frames[i];
try {
if (doc.frameElement.id != "frameHelp")
{
$('select', window.frames[i].document).hide();
}
} catch (err) { }
}
}
}
function mpeHidden() {
document.documentElement.style.overflow = 'auto';
if (Sys.Browser.name == "Microsoft
Internet Explorer" && Sys.Browser.version < 7) {
$('li').show();
$('select').show();
for (var
i = 0; i < window.frames.length; i++) {
try {
$('select', window.frames[i].document).show();
} catch (err) { }
}
}
}
To avoid the popup being displayed in one corner of the page.
This improper positioning is due to the postion property of the div that contains the modal pop up.
To fix this add style attribute - "position: static;"
To close the popup on background click
$(document).delegate("#_backgroundElement" , "click",
function () {
$find('' ).hide();
});
Comments