html5 audio标签切换播放音乐的方法
<pre>
<audio >测试4</div>
</pre>


<pre>
$('.ceshiqiehuan').each(function () {
$(this).on('touchstart', function () {

$('#music1')[0].pause();
var luyinpath = $(this).attr('luyinpath');
$('#music1').attr('src', luyinpath);
$('#music1')[0].play();
})
})
</pre>
总结
先pause关闭 然后更换路径 然后play播放

相关文章:

  • 2021-12-28
  • 2021-07-21
  • 2021-12-18
  • 2022-01-19
  • 2021-12-03
  • 2022-01-22
猜你喜欢
  • 2021-12-18
  • 2021-07-21
  • 2021-12-25
  • 2021-09-19
  • 2022-12-23
  • 2021-08-17
  • 2021-12-05
相关资源
相似解决方案