springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 12:39:57
96
开关状态正常。在MusicAudio AddEventListener Ended上,无论音乐何时结束,它都不会选择随机歌曲。如果我刷新页面,它将进入无限循环。
HTML
<audio id="main-audio" src=""></audio>
JavaScript
let musicIndex = 1;
repeatBtn.addEventListener('click', (e) => {
const getClass = repeatBtn.className;
switch(getClass){
case "fas fa-redo":
repeatBtn.className = "fas fa-random";
repeatBtn.setAttribute("title", "Playlist Shuffle")
break;
break;
case "fas fa-random":
repeatBtn.className = "fas fa-stop-circle";
repeatBtn.setAttribute("title", "Song Repeat")
break;
case "fas fa-stop-circle":
repeatBtn.className = "fas fa-redo";
repeatBtn.setAttribute("title", "Song Looped")
break;
}
})
musicAudio.addEventListener('ended', () => {
const getClass = repeatBtn.className;
switch(getClass){
case "fas fa-random":
let randIndex = Math.floor(Math.random() * allMusic.length) + 1;
do{
Math.floor(Math.random() * allMusic.length) + 1;
}while(musicIndex = randIndex);
const test = musicIndex = randIndex;
loadMusic(musicIndex);
playMusic();
break;
case "fas fa-stop-circle":
musicAudio.currentTime = 0;
loadMusic(indexNumb)
break;
case "fas fa-redo":
nextMusic()
break;
}
})
顺晟科技:
您的条件当前是赋值,而不是比较。
你写道:
<代码>//..While(音乐指数=随机指数);// ...
应该是:
<代码>//..While(音乐索引==随机索引);// ...
请参阅JavaScript
中=、=和=之间的区别05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11