Mute the soundmanager plugin sounds

I used soundmanager to playing sounds on my website. I have this code: soundManager.setup({ debugMode: false, url: 'http://www.newdayatwork.com/wp-content/themes/roots/static/swf/', }); soundManager.onready(function() { soundManager.createSound({ id:'soundLaag1', url: 'http://www.newdayatwork.com/wp-content/themes/roots/static/wav/laag1.wav' }); soundManager.createSound({ id:'soundLaag2', url: 'http://www.newdayatwork.com/wp-content/themes/roots/static/wav/laag2.wav' }); $(document).on('click', '.nav-main li', function(e) { var item = $(this).attr('class'); switch (item) { case 'menu-imagine active': case 'menu-visie active': soundManager.play('soundLaag1'); break; case 'menu-workspace active': case 'menu-werkplek active': soundManager.play('soundLaag2'); break; default: soundManager.play('soundMidden1'); break; } }); $('.menu-sound').click(function() { soundManager.mute(); }); When you click on a navigation item. Than you have a sound playing. But now the problem. I have a button on my website. You can mute the sounds on the website. But this is not working. When i click on the menu-sound button. I doing this: soundManager.mute(); But than is only the sound off on that page. When you click on that button. But when you click them. Should the sound on the entire website out. How can i fix that? Thanks!

以上就是Mute the soundmanager plugin sounds的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏