使用Leandro Vieira Pinho的Lightbox v 0.5代码。有一个部分用于设置用于关闭灯箱的点击事件。此代码在Chrome和Firefox中运行良好。但是当在IE中使用时,按钮什么都不做。请参阅此处的相关代码。
<script type="text/javascript">
//****MISC UNRELATED CODE****//
// Assigning click events in elements to close overlay
$('#jquery-overlayFinancial,#jquery-lightboxFinancial').click(function () {
_finish();
});
function _finish() {
$('#jquery-lightboxFinancial').remove();
$('#jquery-overlayFinancial').fadeOut(function () { $('#jquery-overlayFinancial').remove(); });
// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
$('embed, object, select').css({ 'visibility': 'visible' });
}
function closelightboxFinancial() {
$('#jquery-overlayFinancial').click();
}
//****MISC UNRELATED CODE****//
</script>
在另一页上关闭按钮代码:
<script type="text/javascript">
function CloseMyPlan() {
try {
parent.closelightboxFinancial();
}
catch (err) {
txt = "There was an error on this page.\n\n";
txt += "Error description: " + err.description + "\n\n";
txt += "Click OK to continue.\n\n";
}
}
</script>
在表单控制页面上关闭按钮IMG标记:
<img alt="Close" style="cursor: pointer" src="<%=_imageServerPath%>images/close_btn.jpg"
onclick="javascript:CloseMyPlan();" />