【问题标题】:Flash banner not working in IE/chromeFlash 横幅在 IE/chrome 中不起作用
【发布时间】:2013-05-28 10:37:01
【问题描述】:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1000" height="309" id="FlashID" title="iMathSmart">
                       <param name="movie" value="new_banner_animation_30_days_free_trial_ver_final_08_logo_border_01.swf" />
                       <param name="quality" value="high" />
                       <param name="wmode" value="opaque" />
                       <param name="swfversion" value="11.0.0.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="new_banner_animation_30_days_free_trial_ver_final_08_logo_border_01.swf" width="1000" height="309">
                         <!--<![endif]-->
                         <param name="quality" value="high" />
                         <param name="wmode" value="opaque" />
                         <param name="swfversion" value="11.0.0.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="#" alt="Get Adobe Flash player" /></a></p>
                         </div>
                         <!--[if !IE]>-->
                       </object>
                       <!--<![endif]-->
                     </object>

【问题讨论】:

    标签: flash internet-explorer google-chrome banner


    【解决方案1】:

    chrome 27.0.1453.94 m 最新版好像不能显示多个flash项。在摆弄 Firebug 时,我想到了以下丑陋但可行的解决方案:

    <script type="text/javascript">
            $(document).ready(function(){
                    if(window.navigator.appVersion.match(/Chrome/)) {
                            jQuery('object').each(function() {
                                 jQuery(this).css('display','block');
                            });
                    }
    
            });
    </script>
    

    您只需要触发与对象的外观有关的东西,就可以开始渲染了。 (您也可以将对象替换为自身的克隆等...)。

    【讨论】:

      【解决方案2】:

      没有 jQuery 也一样:

      <script type="text/javascript">
      if (window.navigator.appVersion.match(/Chrome/)) {
          function chrome_flash_redraw() {
              var objects = document.getElementsByTagName('object');
      
              for (var i = 0, j = objects.length; i < j; i++) {
                  objects[i].style.display = 'block';
              }
          }
      
          if (window.addEventListener) {
              window.addEventListener('load', chrome_flash_redraw, false);
          } else if (window.attachEvent) {
              window.attachEvent('onload', chrome_flash_redraw);
          }
      }
      </script>
      

      只需将此代码放在页面中的任何位置即可。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-07-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-01-31
        • 1970-01-01
        • 2011-10-24
        • 1970-01-01
        相关资源
        最近更新 更多