解决Flash swf嵌入不能100%高度的问题

除了去掉html中w3c相关的代码,还可以用样式来解决,在网上查找到文章如下:

------------分割-----------

因为使用方便,所以开始用SWFObject的js包来显示SWF,但是当SWF的大小设置成为100%后,在Firefox中不显示。

查了一下,原因如下:

It was because I was trying to set the flash files height to 100%. But its parent (div id=wrapper) didn't have a height. And 100% of zero = zero. To fix this, i had to set the wrapper div, the body, and the html's height to 100%.

就是说包含SWF的DIV的Parent DIV的大小没有设置,高度按照0乘以100%来计算,所以高度为0在Firefox中自然就不可见了。
官方的建议是设置一下CSS:

<style type="text/css" media="screen">

html, body, #containerA, #containerB { height:100%; }

body { margin:0; padding:0; overflow:hidden; }

</style>

本次项目登陆页详细代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登录</title>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<style type="text/css" media="screen">
<!--
html, body, #myFlashContentDiv {
height: 100%;
width: 100%;
overflow: hidden;
}
body {
margin:0;
padding:0;
}
-->
</style>
</head>
<body bgcolor="#001a00">
<div id="myFlashContentDiv">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="myFlashContent">
<param name="movie" value="http://static.ikaku.com/swf/login.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="http://static.ikaku.com/swf/login.swf" width="100%" height="100%">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="点击获取最新版FlashPlayer" /> </a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值