利用jQuery实现咪咕音乐官网焦点图切换



55 218 73



特效描述:利用jQuery实现 咪咕音乐官网 焦点图切换,利用jQuery实现咪咕音乐官网焦点图切换

代码结构

1. 引入CSS

<link type="text/css" rel="stylesheet" href="css/index.css" charset="utf-8" />

2. 引入JS

<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/music.common.js"></script>
<script type="text/javascript" src="js/music.lazyload.min.js"></script>

3. HTML代码

<center>
<div class="homepage_swrap">
	<div class="banner">
		<div id="lofslidecontent45" class="lof-slidecontent">
			<div href class="lof-previous">
				Next </div>
			<div href class="lof-next ">
				Previous </div>
			<ul class="lof-main-wapper">
				<li>
				<a href="http://51qianduan.com/?rts/www_p120169_c2160359_stindex.htm?pid=migu1310281&cid=001002A&loc=P1Z1Y1L1N1&locno=1" target="_blank" class="noLogLink">
				<img src="images/242135120131028231440big.jpg_RsT_730x300.jpg" title="咱们结婚吧">
				</a>
				<div class="lof-main-item-desc">
					<p>咱们结婚吧 </p>
				</div>
				</li>
				<li>
				<a href="http://51qianduan.com/?rts/zhuanti/20131023/2238474.htm?pid=migu1310251&cid=001002A&loc=P1Z1Y1L1N1&locno=2" target="_blank" class="noLogLink">
				<img src="images/235634120131025145751big.jpg_RsT_730x300.jpg" title="樂人志_苏打绿:十年一起走过">
				</a>
				<div class="lof-main-item-desc">
					<p>樂人志_苏打绿:十年一起走过 </p>
				</div>
				</li>
				<li>
				<a href="http://51qianduan.com/?rts/zhuanti/20131023/2238909.htm?pid=migu1310241&cid=001002A&loc=P1Z1Y1L1N1&locno=3" target="_blank" class="noLogLink">
				<img src="images/235610620131025141129big.jpg_RsT_730x300.jpg" title="施华洛世奇时尚音乐之旅主题曲《旅程》">
				</a>
				<div class="lof-main-item-desc">
					<p>施华洛世奇时尚音乐之旅主题曲《旅程》 </p>
				</div>
				</li>
				<li>
				<a href="http://51qianduan.com/?rts/zhuanti/20131022/2215021.htm?pid=migu1310231&cid=001002A&loc=P1Z1Y1L1N1&locno=4" target="_blank" class="noLogLink">
				<img src="images/223902720131023122959big.jpg_RsT_730x300.jpg" title="IU_李知恩超强势回归 变身冷艳淑女风采依旧">
				</a>
				<div class="lof-main-item-desc">
					<p>IU_李知恩超强势回归 变身冷艳淑女风采依旧 </p>
				</div>
				</li>
				<li>
				<a href="http://www.51qianduan.com//space.php?do=event&id=175&pid=migu1310252&cid=001002A&loc=P1Z1Y1L1N1&locno=5" target="_blank" class="noLogLink">
				<img src="images/235853620131025161451big.jpg_RsT_730x300.jpg" title="陈楚生11月15日江苏南京歌友会抢票!">
				</a>
				<div class="lof-main-item-desc">
					<p>陈楚生11月15日江苏南京歌友会抢票! </p>
				</div>
				</li>
				<li>
				<a href="http://51qianduan.com/?rts/zhuanti/20131011/2064878.htm?pid=migu1310111&cid=001002A&loc=P1Z1Y1L1N1&locno=6" target="_blank" class="noLogLink">
				<img src="images/208562820131011153905big.jpg_RsT_730x300.jpg" title="那些年我们追过的韩剧">
				</a>
				<div class="lof-main-item-desc">
					<p>那些年我们追过的韩剧 </p>
				</div>
				</li>
				<li>
				<a href="http://51qianduan.com/?rts/zhuanti/20131017/2165811.htm?pid=migu1310181&cid=001002A&loc=P1Z1Y1L1N1&locno=7" target="_blank" class="noLogLink">
				<img src="images/219577820131018163627big.jpg_RsT_730x300.jpg" title="全能星战">
				</a>
				<div class="lof-main-item-desc">
					<p>全能星战 </p>
				</div>
				</li>
				<li>
				<a href="http://www.51qianduan.com//activity/ccontent/gohome.do?pid=migu1310121&cid=001002A&loc=P1Z1Y1L1N1&locno=8" target="_blank" class="noLogLink">
				<img src="images/209103720131012142113big.jpg_RsT_730x300.jpg" title="咪咕音乐 华语词曲创作大赛">
				</a>
				<div class="lof-main-item-desc">
					<p>咪咕音乐 华语词曲创作大赛 </p>
				</div>
				</li>
				<li>
				<a href="http://51qianduan.com/?rts/www_p120169_c477010_stindex.htm?pid=migu1304271&cid=001002A&loc=P1Z1Y1L1N1&locno=9" target="_blank" class="noLogLink">
				<img src="images/49065520131025110622big.jpg_RsT_730x300.jpg" title="周杰伦世界巡回演唱会">
				</a>
				<div class="lof-main-item-desc">
					<p>周杰伦世界巡回演唱会 </p>
				</div>
				</li>
				<li>
				<a href="http://51qianduan.com/?rts/zhuanti/20130626/1019528.htm?pid=migu1306271&cid=001002A&loc=P1Z1Y1L1N1&locno=10" target="_blank" class="noLogLink">
				<img src="images/104870820130627174831big.jpg_RsT_730x300.jpg" title="庾澄庆巡回演唱会">
				</a>
				<div class="lof-main-item-desc">
					<p>庾澄庆巡回演唱会 </p>
				</div>
				</li>
			</ul>
			<!-- END MAIN CONTENT -->
			<!-- NAVIGATOR -->
			<div class="lof-navigator-wapper">
				<ul class="lof-navigator">
					<li>
					<div class="mask">
					</div>
					<img src="images/242135120131028231440.jpg_RsT_80x80.jpg" />
					</li>
					<li>
					<div class="mask">
					</div>
					<img src="images/235634120131025144109.jpg_RsT_80x80.jpg" />
					</li>
					<li>
					<div class="mask">
					</div>
					<img src="images/235610620131025141129.jpg_RsT_80x80.jpg" />
					</li>
					<li>
					<div class="mask">
					</div>
					<img src="images/223902720131023122959.jpg_RsT_80x80.jpg" />
					</li>
					<li>
					<div class="mask">
					</div>
					<img src="images/235853620131025161451.jpg_RsT_80x80.jpg" />
					</li>
					<li>
					<div class="mask">
					</div>
					<img src="images/208562820131011153905.jpg_RsT_80x80.jpg" />
					</li>
					<li>
					<div class="mask">
					</div>
					<img src="images/219577820131018163627.jpg_RsT_80x80.jpg" />
					</li>
					<li>
					<div class="mask">
					</div>
					<img src="images/209103720131012142113.jpg_RsT_80x80.jpg" />
					</li>
					<li>
					<div class="mask">
					</div>
					<img src="images/49065520130424213622.jpg_RsT_80x80.jpg" />
					</li>
					<li>
					<div class="mask">
					</div>
					<img src="images/104870820130627174831.jpg_RsT_80x80.jpg" />
					</li>
				</ul>
			</div>
			<!-- END MAIN CONTENT -->
			<!-- NAVIGATOR --></div>
	</div>
	<!-- banner end }-->
	<script type="text/javascript">
			$(function(){
				var lazy = new ImagesLazyLoad({
					mode: "dynamic",attribute:"original",delay:  300,
					holder: getIndexUrl().base_html+"/images/o_dot.gif"
				});
				lazy.resize();
				//tab切换
				/*/$("ul.css-tabs").tabs("div.css-panes > div");*/
				var $cssTabs =$(".css-tabs li");
				$(".css-panes > div").addClass("css-panes-con").hide();
				$(".css-panes .css-panes-con:first-child").show();
				$cssTabs.click(function(){
					$(this).addClass("current").siblings().removeClass("current");
					$(this).parent().next().find(".css-panes-con").hide().eq($(this).index()).show();
					lazy.resize();
				});
				$("ul.list_title_tab li").find(".icon_sj_tab_blue").hide();
				$("ul.list_title_tab li.current").find(".icon_sj_tab_blue").show();
				$("ul.list_title_tab li").click(function() {
					$(this).siblings().find(".icon_sj_tab_blue").hide();
					$(this).find(".icon_sj_tab_blue").show();
				});
               //banner图片滚动
				var $lof = $(".lof-main-wapper li");
				var lof_flag = 0;
				var lof_auto=setInterval(showNext,4000);
				//var lof_auto=setInterval(showNext,9999999999999);
				lof_init(0);
				$(".lof-previous,.lof-next,.lof-navigator li").hover(function(){
					clearInterval(lof_auto);
				},function(){
					//lof_auto=setInterval(showNext,9999999999999);
					lof_auto=setInterval(showNext,4000);
				});
				$(".lof-navigator li").hover(function(){
					lof_flag=$(".lof-navigator li").index($(this)[0])
					lof_init(lof_flag);
				});
				$(".lof-previous").click(function() {
					showPre();
					return false;
				});
				$(".lof-next").click(function() {
					showNext();
					return false;
				});
				function lof_init(index) {
					$lof.hide().eq(index).show()
					.parent().next().find(".mask").removeClass("active")
					.eq(index).addClass("active");
				}
				function showNext() {
					if (!$lof.is(":animated")) {
						if (lof_flag == 7) {
							lof_init(0);
							lof_flag = 0;
						} else {
							lof_flag++;
							lof_init(lof_flag);
						}
					}
				};
				function showPre() {
					if (!$lof.is(":animated")) {
						$lof.hide().removeClass("active");
						if (lof_flag == 0) {
							lof_init(7);
							lof_flag = 7;
						} else {
							lof_flag--;
							lof_init(lof_flag);
						}
					}
				}
				});
		</script>
</div>
</center>
<div style="text-align:center;clear:both"><br>
</div>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 图片拖动 图片放大镜 图片叠加 图片翻转旋转 图片延迟加载 图片淡出淡进 图片全屏 图片头像上传 二维码 滚动切换 滑动选项卡切换 图片广告 图片放大缩小 html5图片动画 带缩略图的幻灯片 地图 flash焦点图 图片滚动 图片滑动 图片切换 图片收缩展开 旋转木马 图片轮播 自动滚动图片轮播 图标导航菜单 选项卡切换 滑动手风琴 背景切换 滑动星星打分 手风琴 图表 焦点图幻灯片 图片 头像截图 其他更多 带标题的焦点图 缩略图 图片切换 图片轮播 选项卡自动切换 鼠标滑过

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

加群请备注:从官网了解到