【问题标题】:Have swf video link to new page with html/csss?有 swf 视频链接到带有 html/css 的新页面吗?
【发布时间】:2010-08-29 09:35:52
【问题描述】:
所以我有一个带有简单动画的 swf - 用于包含它的 div 有一个边框,当你悬停时会改变颜色 - 我希望整个内容在单击时链接到一个新页面 - 但现在它只适用于你点击边框。
这是我目前所拥有的
(a href="http://" class="noDecoration" )
(div id="ink" class="galleryBox" )
(/a)
-div 显示 swf 对象是否可以从 html 中做到这一点?
谢谢
【问题讨论】:
标签:
html
css
flash
hyperlink
【解决方案1】:
该问题的一种解决方案是将链接放在 div 内,并将其放置在 swf 的顶部作为覆盖。
只需确保 swf 的 wmode 参数设置为 transparent,否则您将无法将 HTML 对象放在 swf 之上。我通常使用swfObject 来嵌入我的 swf,以防你不知道。
HTML
<div id="ink" class="galleryBox">
<object width="500" height="500" type="application/x-shockwave-flash" data="filename.swf">
<param name="wmode" value="transparent">
</object>
<a href="http://" class="noDecoration"></a>
</div>
CSS
#ink {
position:relative; width:500px; height:500px;
}
#ink a {
display:block; position:absolute; top:0; left:0; width:100%; height:100%;
}
【解决方案2】:
flash 对象捕获鼠标点击,因此您必须将链接导航代码放在 flash 代码中,通常是 onRelease 和 gotoUrl(我不是 flash 开发人员,我不知道具体细节)。
我能想到的唯一方法是破解并且并非所有浏览器都支持,您可以在 Flash 内容的顶部放置一个半透明的 div,这样就会有链接。问题是大多数 linux flash 播放器和其他播放器将永远处于领先地位,无论您设置什么 z-index。