update method of communication between iframe and embed script
This commit is contained in:
@@ -9,5 +9,14 @@
|
||||
<body>
|
||||
<div id="remark42"></div>
|
||||
<script type="text/javascript" src="/web/remark.js"></script>
|
||||
<script>
|
||||
var lastHeight = 0;
|
||||
setInterval(() => {
|
||||
if (document.body.offsetHeight !== lastHeight) {
|
||||
lastHeight = document.body.offsetHeight;
|
||||
window.parent.postMessage(JSON.stringify({ remarkIframeHeight: lastHeight }), '*');
|
||||
}
|
||||
}, 200);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user