Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Imitate KuGou html5 mobile music player how to write the main part of the code

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

仿酷狗html5手机音乐播放器主要部分代码怎么写,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

HTML5作品,经测试,效果确定不错,遗憾的是只支持谷歌和苹果等以webkit核心的浏览器,网友体验的时候请使用谷歌等浏览器来运行,不然的话无法看到效果

代码如下:

主要部分代码如下:

function ZzxMusic(){

var aa={};

//模块设置

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}

};

//默认加载模块

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");

})

}

//实例化控制台

var myControl = new Control({

audio : document.getElementById("myMusic"), //播放器

playModeNode : $("#modeButton"), //模式选择按钮

playBtn : $("#playButton"), //主控按钮

playTitle : $("#musicTitle"), //歌曲TITLE容器

singerHead : $("#singerHead"), //歌曲插图容器

progressWrap : $("#progressWrap"), //歌曲进度条容器

progress : $("#progress"), //歌曲进度条

oWinObj : $("#oWindow"), //警告窗容器

allTimeNode : $("#totleTime"), //当前时间容器

currentTimeNode : $("#currentTime") //当前时间容器

});

ZzxMusic();

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注行业资讯频道,感谢您对的支持。

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report