Flash横幅无法在IE / chrome中工作

时间:2013-05-28 10:37:02

标签: flash internet-explorer google-chrome banner

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

2 个答案:

答案 0 :(得分:5)

似乎最新版本的chrome 27.0.1453.94 m无法显示多个闪存项目。当摆弄Firebug时,我想到了以下丑陋但有效的解决方案:

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

        });
</script>

你只需触发与对象外观有关的内容即可开始渲染。 (你也可以用自己的克隆替换对象等等。)。

答案 1 :(得分:0)

没有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>

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