1、首先在父页面定义一个空间,Id=layerResult
然后
layer.open({ type: 2, title: '选择看课件', shadeClose: true, shade: 0.8, offset: ['10px', '50px'], area: ['650px', '480px'], maxmin: true, content: url, //iframe的url end: function (index) { var retVal = $("#layerResult").val();//返回一个标记用于控制 if (retVal != "" || retVal != "undefined") { var arr = retVal.split(','); } } });
关闭
parent.document.getElementById("layerResult").value = result; var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 parent.layer.close(index); //再执行关闭