感谢您的支持。
它似乎仍然不起作用。我纠正了一些东西的广告尝试这样第一:
function PlaySound(soundobj) {
var thissound=document.getElementById(soundobj);
/* putting sound on hold and setting volume to 0 */
thissound.pause().prop("volume", 0);
/* on mouse hover event, play sound and fade in the volume in 1s */
thissound.mouseover(function() {
thissound.play().animate({volume: 1}, 1000);
});}
function StopSound(soundobj) {
var thissound=document.getElementById(soundobj);
/* on mouse out event, fade out the volume in 1s */
thissound.mouseout(function() {
thissound.animate({volume: 0}, 1000)}
});
thissound.pause();
thissound.currentTime = 0;
}
我的问题是, 将初始音量设置从函数PlaySound分开吗? 应该在mouseout函数中的行如下:thissound.play().animate({volume: 0}, 1000)}
谢谢