我有一个JQuery弹出窗口,我编写如下脚本。
<style>
.ui-widget-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000;
opacity: 0.7;
z-index: 0;
}
</style>
var wWidth = $(window).width();
var dWidth = wWidth * 0.85;
var wHeight = $(window).height();
var dHeight = wHeight * 0.85;
$('#QualifyLead').dialog({
autoOpen: false,
draggable: false,
resizable: false,
bgiframe: false,
modal: true,
width: dWidth,
height: dHeight,
closeOnEscape: false,
title: "Enter Qualify Lead Information",
open: function (type, data) {
$(this).parent().appendTo("form");
}
});
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (evt, args) {
var wWidth = $(window).width();
var dWidth = wWidth * 0.85;
var wHeight = $(window).height();
var dHeight = wHeight * 0.85;
$('#QualifyLead').dialog({
autoOpen: false,
draggable: false,
resizable: false,
bgiframe: false,
modal: true,
width: dWidth,
height: dHeight,
closeOnEscape: false,
title: "Enter Qualify Lead Information",
open: function (type, data) {
$(this).parent().appendTo("form");
}
});
});
这有一个问题。当我的网格中有很多记录时(点击网格按钮打开弹出窗口),我必须滚动才能看到最后一行。当我单击最后一行的按钮时,弹出窗口不适合窗口的高度。您可以查看附带的屏幕截图。
我错过了什么?
答案 0 :(得分:0)
而不是:
var wHeight = $(window).height();
试试这个:
var wHeight = $(window).css("height");