【问题标题】:Jquery not working in flash on IE 6 and Chrome browsersJquery 无法在 IE 6 和 Chrome 浏览器上运行
【发布时间】:2012-02-14 08:07:32
【问题描述】:

HTML 结构

    <div class="dinz-slider-film trigger-vid">
<object width="480" height="340" class="vid-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FlashID" style="visibility: visible;">
  <param value="sites/all/themes/subtheme/images/test.swf" name="movie">
  <param value="high" name="quality">
  <param value="opaque" name="wmode">
  <param value="6.0.65.0" name="swfversion">
  <!-- 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 value="sites/all/themes/subtheme/Scripts/expressInstall.swf" name="expressinstall">
  <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
  <!--[if !IE]>-->
  <object width="480" height="340" data="/sites/all/themes/subtheme/images/test.swf" type="application/x-shockwave-flash">
    <!--<![endif]-->
    <param value="high" name="quality">
    <param value="opaque" name="wmode">
    <param value="6.0.65.0" name="swfversion">
    <param value="sites/all/themes/subtheme/Scripts/expressInstall.swf" name="expressinstall">
    <!-- 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 width="112" height="33" alt="Get Adobe Flash player" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"></a></p>
    </div>
    <!--[if !IE]>-->
  </object>
  <!--<![endif]-->
</object>
<script type="text/javascript">
&lt;!--
swfobject.registerObject("FlashID");
//--&gt;
</script>
</div>

Jquery 代码:

$('.trigger-vid object.vid-flash').click(function() {
    alert('stop');
  clearInterval(play); //Stop the rotation
});

以下 jquery 代码在 mozilla 中运行良好。但在 Chrome 和 IE 6+ 中无法正常工作

我坚持这一点......但我很清楚(或可能)有一个问题是上面的 HTML 结构。

任何想法都会很感激和有帮助...

【问题讨论】:

  • 它与 jQuery 无关 - 使用 JavaScript 无法单击 Flash .. 也许现在有些浏览器允许这样的事情,但据我所知它仍然不是标准的。

标签: jquery html flash object


【解决方案1】:

使用 onmousedown 代替 onclick。

此答案是重复问题javascript onclick event over flash object的副本

达尔文回答了这个问题……

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-08
    相关资源
    最近更新 更多