How to prevent an iframe from re-sizing when zooming

雨燕双飞 提交于 2019-12-08 17:29:44
Ria Weyprecht

Solution with JS:

take a look at this How to detect page zoom level in all modern browsers? for example to detect the browser zoom level and then multiply the width and height of your iframe with the inverse value so in the end they visually stay the same.

Example: zoom level is 1 (Standard): width: 100px; height: 50px; zoom level is 2: width: 50px; height: 25px; -> Browser shows it double the size so it stays the same

just added: I still wouldn't recommend doing it due to usability ;)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!