zoukankan      html  css  js  c++  java
  • 真正的让iframe自适应高度 兼容多种浏览器随着窗口大小改变

    http://blog.csdn.net/alex8046/article/details/51456131

    <!DOCTYPE html>
    <html lang="zh">
    <head>
    	<title>{$config.site_name}</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    	<meta name="keywords" content="{$config.site_keywords|escape:html}" />
    	<meta name="description" content="{$config.site_description|escape:html}" />
    	<LINK href="/static/css/reset.css" type=text/css rel=stylesheet>
    	<LINK href="/static/css/gameplay.css" type=text/css rel=stylesheet>
    	<script type="text/javascript" src="/static/js/jquery.min.js"></script>
    	<script>
    		{literal}
    		$(function(){
    				adjustWidthHeight();
    		});
    		function adjustWidthHeight() {
    				var width = $(window).width(); //浏览器当前窗口可视区域宽度
    				var height = $(window).height();
    				$("#g_canvas").width(width - 50);
    				$("#g_canvas").height(height - 40);
    				//$('#gameifr').width(width - 50);
    				//$('#gameifr').height(height - 40);
    		}
    		$(window).resize(function () {
    				adjustWidthHeight();
    		});
    		{/literal}
    	</script>
    </head>
    <body>
    <div class="top">
    这是头部
    </div>
    <div id="g_canvas">
    <iframe id="gameifr" scrolling="auto" src="{$game_login_gateway}" frameborder="no" width="100%" height="100%" style="overflow: auto;"></iframe>
    </div>
    </body>
    </html>
    

      

  • 相关阅读:
    cf B. Vasily the Bear and Fly
    hdu 3339 In Action
    hdu 六度分离
    cf A. Vasily the Bear and Triangle
    cf C. Secrets
    2.19学习笔记|2.20学习笔记
    VAE代码学习
    2.9日学习记录
    deconvolution反卷积(待学习)
    gamma分布学习
  • 原文地址:https://www.cnblogs.com/as3lib/p/6603366.html
Copyright © 2011-2022 走看看