我有這個代碼即時通訊使用在我的網頁上播放音樂即時通訊開發,但我有問題如何嵌入或播放更多的一首歌..我想當人們訪問我的網站他們可以播放music.anyone與我如何修改此代碼的想法?在我的網頁上嵌入多首歌曲
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Welcome to Groundswell </title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#play-bt").click(function(){
$("#audio-player")[0].play();
$("#message").text("Music started");
})
$("#pause-bt").click(function(){
$("#audio-player")[0].pause();
$("#message").text("Music paused");
})
$("#stop-bt").click(function(){
$("#audio-player")[0].pause();
$("#audio-player")[0].currentTime = 0;
$("#message").text("Music Stopped");
})
})
</script>
</head>
<body>
<audio id="audio-player" name="audio-player" src="02 - Hillsong - Run.mp3"></audio>
<div id="message"></div>
<a id="play-bt" href="#">Play music</a> | <a id="pause-bt" href="#">Pause music</a> | <a id="stop-bt" href="#">Stop music</a>
</body>
</html>
你使用什麼庫? – Headshota
難道你不能複製代碼但使用不同的ID嗎? – sooper