在下面代码的基础上,右下角消息提示框出现如何同时播放个声音,弄了好久没弄出来,求高手帮忙
静态页面JS实现。<head>
<style type="text/css">
#dd1
{
height: 37px;
width: 182px;
}
</style>
</head>
<script src="BottomMessage.js" type="text/javascript"></script>
<script>
function showmsg(Y,N)
{
var MSG1 = new CLASS_MSN_MESSAGE("aa",300,180,"在线答疑消息提示:","有人上线","系统提醒您,咨询列表有变化!");
MSG1.rect(null,null,null,screen.height-50);
MSG1.speed = 10;
MSG1.step = 5;
//alert(MSG1.top);
MSG1.timeout = 200;
MSG1.show();
var mysong = new Sound()
// mysong.attachSound("sound/aa.mp3")
mysong.playSound("sound/aa.mp3", NULL, SND_FILENAME | SND_SYNC);
}
</script>
<input type="text" id="dd1" value="click" onclick="showmsg('a','a')" />
</input>
静态页面JS实现。<head>
<style type="text/css">
#dd1
{
height: 37px;
width: 182px;
}
</style>
</head>
<script src="BottomMessage.js" type="text/javascript"></script>
<script>
function showmsg(Y,N)
{
var MSG1 = new CLASS_MSN_MESSAGE("aa",300,180,"在线答疑消息提示:","有人上线","系统提醒您,咨询列表有变化!");
MSG1.rect(null,null,null,screen.height-50);
MSG1.speed = 10;
MSG1.step = 5;
//alert(MSG1.top);
MSG1.timeout = 200;
MSG1.show();
var mysong = new Sound()
// mysong.attachSound("sound/aa.mp3")
mysong.playSound("sound/aa.mp3", NULL, SND_FILENAME | SND_SYNC);
}
</script>
<input type="text" id="dd1" value="click" onclick="showmsg('a','a')" />
</input>
<script type="text/javascript" language="JavaScript">
function play()
{
//注意文件路径,且文件大小一般10kb以内
document.all.bgs.src="Notify.wav";
}
</script>
在<body> 内加
<bgsound loop="1" id="bgs"/>
<span onclick="play()" >Sunny Spring</span>