DIV用CSS作,Flash用JavaScript來作
第一種方法用CSS來讓包住DIV的所有標籤設為高100%就可(只設定DIV的話是沒用的)
,DIV變滿整個螢幕後,Flash的高100%就會跟者放滿
<html>
<head>
<script type="text/javascript" src="/Scripts/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.xmlPath = "XML的路徑";
var params = {};
params.allowfullscreen = true;
params.allowscriptaccess = "always";
params.bgcolor = "222222";
swfobject.embedSWF("Flash路徑", "flashContent", "100%", "100%", "9.0.124", false, flashvars, params);
</script>
<style type="text/css" media="screen">
html, body { height:100%; }
</style>
</head>
<body>
<div id="flashContent"> requires JavaScript and the Flash Player<a href="http://get.adobe.com/flashplayer/">若沒裝Flash由此取得Flash</a>
</div>
</body>
</html>
第二種讓DIV的高變成100%的方法是從DIV開始,把每個包住DIV的標籤的高都設成100%就可,如下:
<html style="height: 100%">
<body style="height: 100%">
<div id="flashContent" style="height: 100%">requires JavaScript and the Flash Player. <a href="http://get.adobe.com/flashplayer/">若沒裝Flash由此取得Flash </a>
</div>
</body>
</html>
留言列表