是否有人知道如何將swf文件集中到每一邊,而不僅僅是保持以不同屏幕分辨率爲中心的權利?如何將swf文件放在不同的屏幕資源上?
我希望它與本網站的橫幅相似http://www.mondoliving.com.au/如果更改屏幕分辨率或瀏覽器窗口大小,圖像將保留在中間位置,但不會僅縮放顯示的寬度,這似乎是通過在每一面裁剪而改變的。
我已經嘗試使用JavaScript,它適用於不同的屏幕分辨率,但首先加載左邊的瑞士法郎然後居中它似乎跳進中心。我想知道是否有人用不同的,更流暢的方式來做到這一點?我想知道是否可以用SWF內的Action腳本完成?
我使用的JavaScript是:
<script type="text/javascript">
function centerSWF()
{
var sw;
if(parseInt(navigator.appVersion)>3)
{
if(navigator.appName=="Netscape"){sw = window.innerWidth-17;}
if(navigator.appName.indexOf("Microsoft")!=-1){sw = document.body.offsetWidth-0;}
}
var w = (sw-1500)/2;
document.getElementById("flashbg").style.width = sw+"px";
document.getElementById("flash").style.marginLeft = w+"px";
}
</script>
</head>
<body onload="centerSWF()">
然後我嵌入瑞士法郎。
嵌入式代碼:
<div id="flash_box">
<div id="flashbg" class="flashbg">
<div id="flash" class="flash">
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1500" height="250">
<param name="movie" value="img/top14.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="scale" value="noborder" />
<param name="swfversion" value="9.0.45.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="img/top14.swf" width="1500" height="250">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="9.0.45.0" />
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</div>
</div>
<!--End flash_box -->
而CSS:
#flash_box {
margin:auto;
padding:0px 0px 5px 0px;
border-bottom:double #e9e8e8 thin;
border-collapse:collapse;
height:250px;
overflow:hidden;
}
.flashbg{position:absolute;overflow:hidden;}
.flash{width:1500px;}
感謝 任何幫助極大的讚賞。
請添加嵌入代碼 – Dipak
哪裏呢.....在HTML? – Dipak
對不起,我已將它添加到帖子中, – user1462758