This article for everyone to share the jquery implementation of the music playback audition list, you can achieve playback, pause, automatic access to audio path function, the specific contents are as follows
1.html file
<! DOCTYPE html>
@author fucmlif//@date 2016/4/6//JQuery ("A.user_doplay"). Click (function () {var x = document.getElementById ("
Myaudio "); if (x.paused) {jQuery ("A.user_doplay"). Find (' img '). attr (' src ', ' http://sandbox.runjs.cn/uploads/rs/424/shsayjwv/
Play.png ');
JQuery (This). FIND (' img '). attr (' src ', ' http://sandbox.runjs.cn/uploads/rs/424/shsayjwv/stop.png ');
JQuery (This). attr ("name", "playing"); X.play (); Play} else if (X.play && jquery (this). attr ("name") = = "stoped") {jquery (' #myAudio '). attr (' src ', jQuery (this). A TTR (' id ') + '. mp3 ');//Modify the Audio path JQuery ("A.user_doplay"). Find (' img '). attr (' src ', ' http://sandbox.runjs.cn/uploads/rs/
424/shsayjwv/play.png ');
JQuery (This). FIND (' img '). attr (' src ', ' http://sandbox.runjs.cn/uploads/rs/424/shsayjwv/stop.png ');
JQuery ("#play_list_ol"). Find (' a '). attr (' name ', ' stoped ');
JQuery (This). attr ("name", "playing"); X.play (); Play} else if (X.play && jQuery (this). attr ("name") = = "playing") {JQuery (this). FIND (' img '). attr (' src ', ' http://sandbox.runjs.cn/uploads/rs/424/shsayjwv/play.png ');
JQuery ("#play_list_ol"). Find (' a '). attr (' name ', ' stoped '); X.pause ();
Pause} else {alert ("This hint should not appear");
}
});
The above is the entire content of this article, I hope to help you learn.