我有 jQuery 弹出代码,但我还需要在打开弹出窗口时播放声音。jQuery 弹出窗口打开,但声音不播放js fiddle
代码:
function lightbox() {
$.colorbox({
inline: true,
width: "26%",
height: "85%",
href: "#inline_content",
overlayClose: false
});
}
function loadSound() {
lightbox();
document.jukebox.play();
}
标记:
<embed src="skype.mp3" autostart='true' hidden='true' loop='true' name="jukebox">
<div style='display:none%;' id="content">
<div id='inline_content' style='padding:0px; padding-bottom:0px;'></div>
</div> <a href="javascript:loadSound();">click</a>