Commit 0268d691 authored by Allencl's avatar Allencl

1

parents
Pipeline #150 canceled with stages
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<iframe
id="iframeTree"
src="tree-detail-html/index.html"
style="display:none;height:-webkit-fill-available;width:-webkit-fill-available;z-index: 9999;;top:0px;position:fixed;left:0px;"
frameborder="0"
width="500"
height="300"
scrolling="no"
allowTransparency="true"
></iframe>
<!-- <h1>111</h1> -->
<button id="btnTest">按钮</button>
<script type="text/javascript" src="tree-detail-html/js/jquery.js"></script>
<script>
$(document).ready(function() {
// 关闭 Iframe
window.addEventListener('message', function (event) {
const _data=JSON.parse(event.data)
if(_data.event=="closeIframe"){
document.querySelector("#iframeTree").style.display="none"
}
},false)
// 打开 Iframe
document.querySelector("#btnTest").onclick=function(){
document.querySelector("#iframeTree").contentWindow.postMessage(JSON.stringify({
event:"open"
}),'*')
document.querySelector("#iframeTree").style.display="block"
}
});
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment