diff --git a/www/assets/js/music.js b/www/assets/js/music.js index 41a6a41..f8838ff 100644 --- a/www/assets/js/music.js +++ b/www/assets/js/music.js @@ -141,3 +141,10 @@ document.querySelector("#title-screen").addEventListener("click", function () { setVolume(); sfxOpen.play(); }); + +document.addEventListener("visibilitychange", function () { + bgmDungeon.stop(); + bgmBattleMain.stop(); + bgmBattleGuardian.stop(); + bgmBattleBoss.stop(); +});