解决联想 Pad 浏览器上控件不可用的问题
问题描述:
在联想的 Pad(Android 3.1)浏览器上,打开 PopupWindow 时,如果页面上出现滚动条,也就是不能完全显示的时候,凡是需要拉动滚动条才能看到的控件或链接都变得不起作用。这个问题在 PC 的浏览器上肯定是没有。原因不明。
解决思路:
调整 PopupWindow 的高度或宽度。
在 Popup 页面的 $.ready() 方法中,取得 document 的高度,然后调用父类窗体的方法,设置 PopupWindow 的高度。
参考代码:
1. Popup页面上的代码:
$(document).ready(function() {
parent.setPopupHeight($(document).height());
});
2. 父类窗体上的代码:
function setPopupHeight(documentHeight) {
$("#pWindow1").height(documentHeight + 100); // 其中 100 是标题、边框等的高度,依具体情况定
}