var myMusic = null; var MyMusic = function(){ var _this = this; var musicBox_H = document.getElementById("musicBox"); var music = "音乐播放器/images/music/"; //音乐列表 var musicFiles=[ new MusicObj("01爱的故事","/yinyue/传神基金会/恋爱在圣诞/01爱的故事1.mp3","传神基金会",0,1), new MusicObj("02爱到底","/yinyue/传神基金会/恋爱在圣诞/02爱到底.mp3","传神基金会",0,1), new MusicObj("03耶稣,圣洁尊贵救主","/yinyue/传神基金会/恋爱在圣诞/03耶稣,圣洁尊贵救主.mp3","传神基金会",0,1), new MusicObj("04耶和华是我牧者","/yinyue/传神基金会/恋爱在圣诞/04耶和华是我牧者.mp3","传神基金会",0,1), new MusicObj("05耶稣是王","/yinyue/传神基金会/恋爱在圣诞/05耶稣是王.mp3","传神基金会",0,1), new MusicObj("06爱的故事","/yinyue/传神基金会/恋爱在圣诞/06爱的故事2.mp3","传神基金会",0,1), new MusicObj("07 Tanya’s Song 用脚飞翔","/yinyue/传神基金会/恋爱在圣诞/07 Tanya’s Song 用脚飞翔.mp3","传神基金会",0,1), new MusicObj("08 Jesus is Sweet 耶稣何等甜美","/yinyue/传神基金会/恋爱在圣诞/08 Jesus is Sweet 耶稣何等甜美.mp3","传神基金会",0,1), new MusicObj("09爱的故事","/yinyue/传神基金会/恋爱在圣诞/09爱的故事3.mp3","传神基金会",0,1), new MusicObj("10 Always on My Mind 常驻我心","/yinyue/传神基金会/恋爱在圣诞/10 Always on My Mind 常驻我心.mp3","传神基金会",0,1), new MusicObj("11 Chariots of Fire 火战车","/yinyue/传神基金会/恋爱在圣诞/11 Chariots of Fire 火战车.mp3","传神基金会",0,1), new MusicObj("12爱的故事","/yinyue/传神基金会/恋爱在圣诞/12爱的故事4.mp3","传神基金会",0,1), new MusicObj("13更新我心意","/yinyue/传神基金会/恋爱在圣诞/13更新我心意.mp3","传神基金会",0,1), new MusicObj("14他何等爱你和我","/yinyue/传神基金会/恋爱在圣诞/14他何等爱你和我.mp3","传神基金会",0,1), ]; //播放模式 1-全部循环 2-单曲循环 3-随机播放 var playMode = 1; //当前音乐播放的下标 var index = -1; var length = musicFiles.length; var playMode_H = $("#playMode"); var musicList_H = $("#musicList"); var playMsg_H = $("#playMsg"); var name = $("#name"); var author = $("#author"); var CD = $("#CD"); var picInfo = $("#picInfo"); var pop =$("#pop"); var playMsg = null; _this.fristMusic = function(){ index = 0; _this.play(); } _this.playOrPause=function(){ pop.addClass("Gray"); var popVal = pop.attr("imgVal"); if(popVal == 0){ pop.attr("src","music/play.png"); pop.attr("title","点击播放"); pop.attr("imgVal","1"); musicBox_H.pause(); }else{ pop.attr("src","music/pause.png"); pop.attr("title","点击暂停"); pop.attr("imgVal","0"); musicBox_H.play(); } } _this.end = function(){ index = length -1; _this.play(); } _this.lastMusic = function(){ if(index == 0){ index = length-1; }else{ index --; } _this.play(); } _this.loadMusic = function(){ for(var i in musicFiles){ var html = "