57 lines
1.4 KiB
HTML
57 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>wikiframe test 3</title>
|
|
<meta name="viewport" content="width=device-width">
|
|
<meta charset="utf-8">
|
|
<style type="text/css">
|
|
body {
|
|
overflow: auto;
|
|
background: pink;
|
|
}
|
|
#map {
|
|
position: absolute;
|
|
left: 0; top: 0;
|
|
bottom: 0; right: 0;
|
|
z-index: 0;
|
|
}
|
|
#map a {
|
|
position: relative;
|
|
left: 200px;
|
|
top: 200px;
|
|
}
|
|
#page {
|
|
position: absolute;
|
|
left: 0; right: 0;
|
|
top: 60vh;
|
|
height: 40vh;
|
|
}
|
|
#page iframe {
|
|
width: 100%;
|
|
height: 100%;
|
|
border: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="map"><a href="#">map</a></div>
|
|
<div id="page">
|
|
<iframe src="/mw"></iframe>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
var page = document.querySelector("#page"),
|
|
iframe = document.querySelector("iframe");
|
|
|
|
iframe.addEventListener("load", function () {
|
|
var ifh = iframe.contentWindow.document.body.scrollHeight;
|
|
console.log("load", ifh);
|
|
page.style.height = ifh+"px";
|
|
});
|
|
window.addEventListener("resize", function () {
|
|
var ifh = iframe.contentWindow.document.body.scrollHeight;
|
|
console.log("load", ifh);
|
|
page.style.height = ifh+"px";
|
|
})
|
|
</script>
|
|
</html> |