jQuery Iframe 父页面监听子页面的鼠标点击事件
一、父页面加入iframe:
二、父页面加入如下脚本:
$(function () {
$("\#ifrmReport").height($(document).height()+200);
var bodyWidth = $(document.body).width();
$("\#ifrmReport").width(bodyWidth - 200);
var iframe = document.getElementById('ifrmReport');
iframe.onload = function () \{
iframe.contentDocument.onclick = function () \{
iframe.contentWindow.parent.hideZKZ();
\};
\}
\});
function hideZKZ() {
//easyUI combotree关闭下拉选择树
$("\#check\_ZKZ").combobox('hidePanel');
//easyUI combotree收缩下拉选择树
$("\#check\_ZKZ").combotree('tree').tree("collapseAll");
}
还没有评论,来说两句吧...