Anchor tag on flash is not working in chrome
the following code works on everything except 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" t开发者_Go百科ype="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true"></embed>
</object>
</a>
Flash is being used to create an animated button, and the anchor tag makes it so you can click on that to go to another page. On most browsers, you can click anywhere on the Flash object and the link works...but in Chrome, the link displays in the status bar when you hover over the flash element, but does nothing when you click it. However, there is a small area (about 19px) below the flash element where the link works.
How can I get this to behave the same way in Chrome as it is in other browsers?
Try adding a { pointer-events: none; }
to your CSS. Of course, you should adjust the selector so that it only matches this one particular anchor.
For more info on pointer-events
, see http://dev.w3.org/csswg/css3-ui/#pointer-events and https://developer.mozilla.org/en/css/pointer-events.
Try adding the pointer-events:none;
to the flash OBJECT
tag as an inline style:
<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>
That fixed the issue for me in Chrome & did not have any adverse effects in other browsers.
精彩评论