感謝您的支持。
它似乎仍然不起作用。我糾正了一些東西的廣告嘗試這樣第一:
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)}
謝謝