resize iframe if view width is smaller than frame
This commit is contained in:
parent
aaaf02ba1d
commit
36a8e9ce60
@ -151,6 +151,7 @@
|
|||||||
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
||||||
const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
|
const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
|
||||||
|
|
||||||
|
// resize iframe if view width is smaller than frame
|
||||||
if (document.getElementById('live').width > vw) {
|
if (document.getElementById('live').width > vw) {
|
||||||
document.getElementById('live').width = vw;
|
document.getElementById('live').width = vw;
|
||||||
document.getElementById('live').height = vw * (9 / 16);
|
document.getElementById('live').height = vw * (9 / 16);
|
||||||
|
Loading…
Reference in New Issue
Block a user