我有许多 div 覆盖网页背景图像上菜单的不同部分。
在 div 我有一个 href 链接到另一个页面播放点击声音
我使用了一个 CSS 技巧来填充 div,以便光标在 div 上直接改变。请参阅下面的代码
<script language="javascript" type="text/javascript">
function playSound(soundfile) {
"<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
}
</script>
<div id="apWelcome">
<a href= "#" class="fill-div" onclick="playSound('Sounds/click.ogg');"> </a>
</div>
下面列出了 apWelcome 和填写区域的 CSS:
#apWelcome {
cursor: pointer;
position: absolute;
left: 104px;
top: 216px;
width: 49px;
height: 66px;
}
a.fill-div {
cursor: pointer;
display: block;
height: 100%;
width: 100%;
text-decoration: none;
}
问题是,在 FF24 中,点击行为很好,但没有声音,Chrome - 一半工作(声音播放) - 视觉上页面跳下,IE 不显示光标或没有功能。
任何人都知道所有三种浏览器的解决方法或完全不同的方法。谢谢你。