抱歉,如果标题不清楚。我有一个 swiperight 和 swipeleft 事件,当触发时将音频源添加到具有自动播放功能的 html5 音频标签中。因此,如果您向左滑动播放一首歌曲并向右滑动另一首播放..问题是它只能播放一次。如果我向左滑动歌曲播放然后如果我向右滑动什么,再次向左滑动什么,反之亦然。有没有办法重置功能?希望这是有道理的,谢谢!下面是我的代码
<script>
$(document).ready(function() {
$("body").bind("swiperight", function(event){
$('#swipe').append(
'<source src="http://a.tumblr.com/tumblr_ljdvcbDIsN1qhk4f9o1.mp3"/>');
})
$("body").bind("swipeleft", function(event) {
$('#swipe').append('<source src="http://www.nerdthegame.com/media/audio/soundtrack/Nintendo-Super-Mario-Theme-Song.mp3" />');
})
})