-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallTracks.js
27 lines (22 loc) · 924 Bytes
/
allTracks.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function renderAllTrackList() {
const allTracksList = getId('allTracksList');
var template = ''
allTracks.forEach(function(item,index) {
template +=
`
<div class="song" onClick="playSong(${index})">
<div class="left">
<h3 class="song-name">
${item.name}
</h3>
<p class="singer-name">${item.singer}</p>
</div>
<div class="right">
<div class="song-control">${item.duration}</div>
</div>
</div>
`
})
allTracksList.innerHTML = template;
}
renderAllTrackList()