0

さまざまな画面解像度で中央に配置する権利だけでなく、両側をトリミングするswfファイルを中央に配置する方法を知っている人はいますか?

このサイトのバナーに似たものにしたいhttp://www.mondoliving.com.au/画面の解像度またはブラウザ ウィンドウのサイズを変更すると、画像は中央にとどまりますが、拡大縮小されず、表示される幅だけが変更されるようです両側でトリミングします。

さまざまな画面解像度で機能するjavascriptを使用してみましたが、最初に左側にswfをロードしてから中央に配置すると、中央にジャンプするように見えます。誰かが新しい、よりスムーズな方法でそれを行うのだろうかと思っていましたか? SWF 内のアクション スクリプトで実行できるかどうか疑問に思っていました??

私が使用した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()">

次にswfを埋め込みました。

埋め込みコード:

<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;}

ありがとうございました。

4

1 に答える 1

0

これらの変更を CSS で行います -

#flash_box {
margin: 0 auto;
padding:0px 0px 5px 0px;
border-bottom:double #e9e8e8 thin;
border-collapse:collapse;
height:250px;
overflow:hidden;
text-align: center;
}
.flashbg{/*position:absolute;overflow:hidden;*/}
.flash{width:1500px; text-align: center;}
于 2012-06-18T07:47:20.127 に答える