Handling of window size changes

This commit is contained in:
Veloman Yunkan 2022-03-19 21:31:00 +04:00
parent 4105be9bd2
commit 228e31cddd
1 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body style="margin:0">
<body style="margin:0" onload="handle_visual_viewport_change()">
<div id=taskbar style="background:#bbffbb">Taskbar</div>
<iframe id="content_iframe"
@ -35,7 +35,11 @@
}
const cf = document.getElementById('content_iframe');
function handle_visual_viewport_change() {
cf.height = window.visualViewport.height - cf.offsetTop - 4;
}
window.onresize = handle_visual_viewport_change;
function handle_location_hash_change() {
const hash = window.location.hash;