闪存上的锚标签在chrome中不起作用

时间:2011-04-13 12:05:43

标签: html css flash google-chrome

以下代码适用于Chrome以外的所有内容:

<a target="_blank" href="/FooodJournal">
        <object width="265" height="135">
            <param name="movie" value="2991BCTTor/xx.swf">
            <param name="allowFullScreen" value="true">
            <param name="allowscriptaccess" value="always">
            <param name="wmode" value="transparent">
            <param name="FlashVars" value="fileID=4928&context=12&embeded=true&environment=production">
            <embed width="265" wmode="transparent" height="135" src="2991BCTTor/xx.swf" flashvars="fileID=4928&context=12&embeded=true&environment=production" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true"></embed>
        </object>
    </a>

Flash正用于创建动画按钮,而锚标签使其可以点击该按钮转到另一个页面。在大多数浏览器中,您可以点击Flash对象上的任意位置并且链接可以正常运行...但是在Chrome中,当您将鼠标悬停在Flash元素上时,链接会显示在状态栏中,但在您点击它时不会执行任何操作。但是,链接工作的闪存元素下方有一个小区域(约19px)。

如何让Chrome在Chrome中的行为与在其他浏览器中的行为相同?

2 个答案:

答案 0 :(得分:0)

尝试将a { pointer-events: none; }添加到您的CSS中。当然,你应该调整选择器,使它只匹配这个特定的锚点。

有关pointer-events的详情,请参阅http://dev.w3.org/csswg/css3-ui/#pointer-eventshttps://developer.mozilla.org/en/css/pointer-events

答案 1 :(得分:0)

尝试将pointer-events:none;添加到flash OBJECT标记作为内联样式:

<a target="_blank" href="/FooodJournal">
        <object width="265" height="135" style="pointer-events:none;">
            <param name="movie" value="2991BCTTor/xx.swf">
            <param name="allowFullScreen" value="true">
            <param name="allowscriptaccess" value="always">
            <param name="wmode" value="transparent">
            <param name="FlashVars" value="fileID=4928&context=12&embeded=true&environment=production">
            <embed width="265" wmode="transparent" height="135" src="2991BCTTor/xx.swf" flashvars="fileID=4928&context=12&embeded=true&environment=production" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true"></embed>
        </object>
    </a>

这解决了我在Chrome&amp;在其他浏览器中没有任何不良影响。

相关问题