关于点击声音问题音量不工作jquery脚本

zf9nrax1  于 2023-05-06  发布在  jQuery
关注(0)|答案(1)|浏览(84)

有人帮我的脚本,音量不工作,我不明白:-(

var should_play = true
should_play.volume = 0.5;
window.onclick = () => {
  if (should_play) {
    should_play = should_play
    let soundSource = "https://kahimyang.com/resources/sound/click.mp3";
    let sound = new Audio(soundSource);
    sound.play();
  }
}

谢谢你;- )
请帮助我,我解决我的问题

9lowa7mx

9lowa7mx1#

var shouldplay = true;
window.onclick =()=> {
    if (shouldplay){
        let soundSource = "https://kahimyang.com/resources/sound/click.mp3";
        let sound = new Audio(soundSource);
        sound.play();       
    }
}

相关问题