You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
2.4 KiB

/********************************************
* 函數名稱:
* 目的:讀取畫面時執行
* 作者:Gary
* 時間:2014/08/27
* 功能說明:
在畫面載入完成後設定過0.7秒後執行,如果不設定可能會導致抓取不到正確的POP頁面。
*********************************************/
$(document).ready(function () {
setTimeout(function () { ChangeHeight() }, 700);
});
/********************************************
* 函數名稱:ChangeHeight()
* 目的:改變POP的高度
* 作者:Gary
* 時間:2014/08/27
* 功能說明:
判斷畫面是否夠空間顯示完整的POP資料,如果無法,則用畫面最大顯示空間減去100px,設定POP視窗為此高度,
如果可以正常顯示完整視窗,則去算內容高度。
*********************************************/
function ChangeHeight() {
var strAction = $("form").attr("action"); //由於可能會有多個POP視窗同時存在,以action為主,當成pk值
var intIframeHeight = top.$("iframe").height(); //取的原本畫面可視高度
var intMaxPopDivHeight = intIframeHeight - 100; //設定Pop最大可允許的高度,規則為原本畫面可是高度減去100px
var intBasePopDivHeight = $(".popmaindiv").height(); //取得Pop頁面基礎高度
var intPopHeaderHeight = $(".popheader").first().height(); //取得Pop頁面標題高度
if (intMaxPopDivHeight <= intBasePopDivHeight) {
this.parent.$("td .aui_main iframe").each(function () {
if ($(this).contents().find("form").attr("action") == strAction) {
$(this).closest(".aui_main").css("height", intMaxPopDivHeight + "px")
}
})
$("#divPopMaxHeight").first().css("height", (intMaxPopDivHeight - intPopHeaderHeight) + "px")
$("#divPopMaxHeight").first().css("overflow-y", "scroll")
}
else {
this.parent.$("td .aui_main iframe").each(function () {
if ($(this).contents().find("form").attr("action") == strAction) {
$(this).closest(".aui_main").css("height", ($("#divPopMaxHeight")[0].scrollHeight + intPopHeaderHeight) + "px")
$(this).closest("#divPopMaxHeight").css("overflow-y", "hidden")
}
})
$("#divPopMaxHeight").first().css("height", $("#divPopMaxHeight")[0].scrollHeight + "px")
$("#divPopMaxHeight").first().css("overflow-y", "hidden")
}
}