ifame全屏显示

<!DOCTYPE html>
<html lang="zh">

<head>
<meta name='robots' content='noindex,follow' />
<meta name='viewport' content='width=device-width, height=device-height;initial-scale=1'/>
<!-- 启用 WebApp 全屏模式 -->
<meta name="apple-mobile-web-app-capable" content="yes" />

<!-- uc强制竖屏 -->
<meta name="screen-orientation" content="portrait">
<!-- UC强制全屏 --> 
<meta name="full-screen" content="yes">
<!-- UC应用模式 --> 
<meta name="browsermode" content="application">

<!-- QQ强制竖屏 -->
<meta name="x5-orientation" content="portrait">
<!-- QQ强制全屏 -->
<meta name="x5-fullscreen" content="true">
<!-- QQ应用模式 -->
<meta name="x5-page-mode" content="app">

<style>
body {margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;overflow: hidden;height:100%}
</style>
</head>

<body>
<iframe id="iframe" name="iframe"
        height="100%"
        width="100%"
        src="http://www.qq.com"
        scrolling="auto"
        frameborder="0"
        onload="changeFrameHeight()">
</iframe>
<script>
    function changeFrameHeight() {
        var iframe = document.getElementById("iframe");
        iframe.height = document.documentElement.clientHeight;
    }
    //onresize属性可以用来获取或设置当前窗口的resize事件的事件处理函数
    //onresize事件会在窗口或框架被调整大小时发生
    window.onresize = function() {
        changeFrameHeight();
    }
</script>
</body>
</html>
posted @ 2022-09-14 17:25  noahBoy  阅读(36)  评论(0)    收藏  举报