Current location - Music Encyclopedia - NetEase Cloud Music - How to use JavaScript to automatically stop the background music when playing a video on a website, and the music continues to play when the video stops.
How to use JavaScript to automatically stop the background music when playing a video on a website, and the music continues to play when the video stops.

Just use js to control: //Play

playBtn.onclick?=?function(){

if?(oAudio.paused)?{< /p>

oAudio.play();

//getElement("musicname").nodeValue?=?musicName;

cmbg.className?=?"musicname" ;

playBtn.className?=?"l?play";

playBtn.setAttribute("title","pause");

}

p>

else?{

oAudio.pause();

cmbg.className?=?"musicnamed";

playBtn.className?= ?"l?pause";

playBtn.setAttribute("title","play");

}

};

html:

Example:/6rooms/html/music.php

There is a problem Keep communicating!