2016-09-13
展开全部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>播放器</title>
<style>
</style>
</head>
<body>
<audio id="music01" src="G.E.M.邓紫棋 - 红蔷薇白玫瑰.mp3" loop="loop">你的浏览器不支持audio标签。</audio>
<a href="javascript:playPause();"><img src="1.jpg" width="50" height="50" id="music_btn01" border="0"></a>
</body>
<script>
function playPause() {
var music = document.getElementById('music01');
var music_btn = document.getElementById('music_btn01');
if (music.paused){
music.play();
music_btn.src = '1.jpg'; //播放图片
}
else{
music.pause();
music_btn.src = '1.jpg'; //暂停图片
}
}
</script>
</html>
<html>
<head>
<meta charset="utf-8">
<title>播放器</title>
<style>
</style>
</head>
<body>
<audio id="music01" src="G.E.M.邓紫棋 - 红蔷薇白玫瑰.mp3" loop="loop">你的浏览器不支持audio标签。</audio>
<a href="javascript:playPause();"><img src="1.jpg" width="50" height="50" id="music_btn01" border="0"></a>
</body>
<script>
function playPause() {
var music = document.getElementById('music01');
var music_btn = document.getElementById('music_btn01');
if (music.paused){
music.play();
music_btn.src = '1.jpg'; //播放图片
}
else{
music.pause();
music_btn.src = '1.jpg'; //暂停图片
}
}
</script>
</html>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询