〈HEAD〉
〈META http-equiv=Content-Type content=“text/html; charset=gb2312“〉
〈/HEAD〉
〈BODY〉
〈SCRIPT〉
function sound()
{
document.write(“〈bgsound src=’mail.wav’〉“);
}
〈/SCRIPT〉
〈a href=“#“ onmouseover=“javascript:sound()“〉声音〈/a〉
〈/BODY〉
〈/HTML〉
另外的代码:
〈OBJECT ID=’AlvinWmaPlayer’ CLASSID=’CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6’ type=’application/x-oleobject’ width=’0’ height=’0’ style=’position:relative;left:0px; top:0px;width:0px;height:0px;’〉
〈param name=’URL’ value=’firework.wav’〉
〈param name=’uiMode’ value=’invisible’〉
〈/OBJECT〉
〈a onmouseover=“AlvinWmaPlayer.controls.stop();AlvinWmaPlayer.controls.play();“〉声音〈/a〉
[文章来源:“十万个为什么”电脑学习网]
[网络地址:http://why100000.com]

这篇博客介绍了如何使用JavaScript在鼠标悬停链接时触发声音播放。通过`<bgsound>`标签和`document.write`函数实现简单的声音播放,以及使用`<OBJECT>`标签结合参数控制WMA文件的播放,使链接在鼠标悬停时播放预设的音频文件。
最低0.47元/天 解锁文章
31

被折叠的 条评论
为什么被折叠?



