仿酷狗html5手機(jī)音樂播放器主要部分代碼

字號(hào):


    HTML5作品仿酷狗html5手機(jī)音樂播放器,經(jīng)測(cè)試,效果確定不錯(cuò),遺憾的是只支持谷歌和蘋果等以webkit核心的瀏覽器,感興趣的朋友可以學(xué)習(xí)下
    代碼如下:
    主要部分代碼如下:
    function ZzxMusic(){
    var aa={};
    //模塊設(shè)置
    var setting = {
    newSong:{'target':'newSong','type':'1','firstCount':6,'Count':5},
    songCharts:{'target':'newSong','type':'1','firstCount':2,'Count':4},
    singer:{'target':'newSong','type':'1','firstCount':8,'Count':7},
    radioStation:{'target':'newSong','type':'1','firstCount':9,'Count':2}
    };
    //默認(rèn)加載模塊
    aa.newSong = new Zzx(setting.newSong);
    //模塊初始化
    $(".menu_tagList").children("li").bind('click',function(){
    for(var i in setting){
    if($(this).attr("id")==i){
    if(typeof aa[i]==='undefined'){
    aa[i] = new Zzx(setting[i]);
    }else{
    aa[i].init();
    }
    }
    }
    $(".menu_hover").removeClass("menu_hover");
    $(this).addClass("menu_hover");
    })
    }
    //實(shí)例化控制臺(tái)
    var myControl = new Control({
    audio : document.getElementById("myMusic"), //播放器
    playModeNode : $("#modeButton"), //模式選擇按鈕
    playBtn : $("#playButton"), //主控按鈕
    playTitle : $("#musicTitle"), //歌曲TITLE容器
    singerHead : $("#singerHead"), //歌曲插圖容器
    progressWrap : $("#progressWrap"), //歌曲進(jìn)度條容器
    progress : $("#progress"), //歌曲進(jìn)度條
    oWinObj : $("#oWindow"), //警告窗容器
    allTimeNode : $("#totleTime"), //當(dāng)前時(shí)間容器
    currentTimeNode : $("#currentTime") //當(dāng)前時(shí)間容器
    });
    ZzxMusic();