fix: page scroll unexpected in iframe

This commit is contained in:
Tristan Yang
2022-08-26 11:28:25 +08:00
parent fd7f6c1483
commit 5ae24d1dbd
+13
View File
@@ -104,6 +104,13 @@
body {
overflow: hidden;
width: 100%;
height: 100%;
}
body.iframe {
position: fixed;
top: 0;
}
a {
@@ -132,5 +139,11 @@
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
<script>
if (window.location !== window.parent.location) {
// The page is in an iframe
document.body.classList.add("iframe")
}
</script>
</html>