2015-06-20 35 views
0

我已將此互動式海報(http://www.mikesmithdesign.co.uk/images/posterforscreen.swf)嵌入到HTML頁面中,但無法設置它的大小。我正在使用bootstrap,希望內容能夠響應,但是現在它出現在列的中間位置,我似乎無法填充整個寬度。我嘗試將寬度和高度設置爲100 %或使用類「img-responsive」,但似乎沒有任何工作。這裏是我的代碼頭:響應大小的swfobject?

 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
     <script type="text/javascript" src="swfobject.js"></script> 
     <script type="text/javascript"> 
     swfobject.registerObject("myFlashContent", "9.0.0"); 
     </script>

和代碼從身體(忽略未關閉div標籤,因爲這僅僅是一個代碼片段而不是整個事情)

<div class="col-md-8 col-md-offset-1 visible-md visible-lg" id="mainContent"> 
    <img src="images/typesketch.jpg" alt="Typographic Development Sketches" class="img-responsive propersize" /> 
    <br /> 
    <br /> 
    <div> 
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="myFlashContent"> 
     <param name="movie" value="posterforscreen.swf"> 
     <!--[if !IE]>--> 
     <object type="application/x-shockwave-flash" data="posterforscreen.swf" class="propersize"> 
     <!--<![endif]--> 
     <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" /> 
     </a> 
     <!-- [if !IE]>--> 
     </object> 
     <!--<![endif]--> 
    </object> 
    </div>

請原諒任何亂碼或不好的做法,我backgr ound是爲打印而設計的,所有這些網頁材料對我來說都有點新鮮。

+0

要調整swf對象的大小,你可以將它的'width'和'height'設置爲'100%',然後你可以隨意調整其父div的大小。 – akmozo

+0

我的問題是你究竟在哪裏設置高度和寬度?在頭上?在體內?或在CSS? –

+0

嘗試使用'img-responsive propersize'類,就像我在[本頁](http://www.mikesmithdesign.co.uk/final-major-project.html)中看到的那樣。如果您有一個在線可見頁面,如果我們可以直接看到使用的代碼,那麼這將更容易幫助您。 – akmozo

回答

0

要解決您的Flash對象的height,你可以根據頁面的大小,這讓我們用圖片的height

CSS代碼:

<style> 

    @media (min-width: 1200px) { 
     .flash_container { 
      height: 499px; 
     } 
    } 

    /* Landscape tablets and medium desktops */ 
    @media (min-width: 992px) and (max-width: 1199px) { 
     .flash_container { 
      height: 410px; 
     } 
    } 

    /* we don't need all these presets 
     because you are showing an image 
     instead of the flash object 
    */ 

    /* Portrait tablets and small desktops */ 
    @media (min-width: 768px) and (max-width: 991px) {} 

    /* Landscape phones and portrait tablets */ 
    @media (max-width: 767px) {} 

    /* Portrait phones and smaller */ 
    @media (max-width: 480px) {} 

</style> 

HTML代碼:

<div class="img-responsive propersize flash_container"> 
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="myFlashContent" width="100%" height="100%"> 
     <param name="movie" value="posterforscreen.swf"> 
     <!--[if !IE]>--> 
     <object type="application/x-shockwave-flash" data="posterforscreen.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="Get Adobe Flash player"></a> 
     <!-- [if !IE]>--> 
     </object> 
     <!--<![endif]--> 
    </object> 
</div> 

Hope這可以幫助。

+0

所有固定和工作,謝謝! http://www.mikesmithdesign.co.uk/final-major-project.html –