期末考试神器

<script type="text/javascript">
		$(function(){
			//二级菜单滑动实现代码
			$(".nav_container>li").hover(
				function(){
					$(this).find("ul").slideDown("fast");
				},
				function(){
					$(this).find("ul").slideUp("fast");
			})
			
			//动态设置轮播图背景图片代码		
			$(".imgBox li").width($(window).width());      //将li的宽度设置为屏幕的宽度
			$(".imgBox>li").each(function(){
				imgURL="url(img/0"+String($(this).index()+1)+".png)";
				$(this).css("background",imgURL+"center center no-repeat");
			})
			
		//轮播效果实现代码
		var imgWidth=$(".imgBox li").eq(0).width();        
		var imgCount=$(".imgBox li").length;    //获取轮播图片的张数
		var imgIndex=0;
		function showImg(imgIndex){
			$(".imgBox").animate({left:-imgWidth*imgIndex});
			$(".imgNav").find("li").eq(imgIndex).addClass("focus").siblings().removeClass("focus");
		}
		$(".next").stop(true,true).click(function(){
			imgIndex++;
			if(imgIndex==imgCount){imgIndex=0;}
			showImg(imgIndex);
			
		})			
		$(".prev").stop(true,true).click(function(){
			imgIndex--;
			if(imgIndex<0){imgIndex=imgCount-1;}
			showImg(imgIndex);				
		})
		
		$(".slideBox").hover(
			function(){
				clearInterval(timer);
			},
			function(){
			    timer = setInterval(function(){
				$(".next").trigger("click")
				},3000);	
			}	
		)
		$(".slideBox").mouseleave();
			
			//轮播图数字导航代码			
			var imgNavWidth=$(".imgNav").width();
			$(".imgNav").css("left",imgWidth/2-imgNavWidth/2);    //设置轮播导航居中显示
			$(".imgNav li").click(function(){
				imgIndex=$(this).index();
				showImg(imgIndex);
			})
			
			//main部分选项卡代码
			$(".tab_content>ul:gt(0)").hide();
			$(".tab_title>li").mouseenter(function(){
				$(this).addClass("active").siblings().removeClass("active");
				$(".tab_content>ul").eq($(this).index()).show().siblings().hide();
			})
			
			
			//无缝图片滑动实现代码	
			$(".subject_list>li:lt(3)").each(function(){
				$(this).clone().appendTo($(".subject_list"));
			})
			
			var teamIndex=0;
			var teamCount=$(".subject_list>li").length;
			
			function showteam(teamIndex){			
				teamleft=-teamIndex*400+"px";
				$(".subject_list").stop(true,false).animate({"left":teamleft});
			}
				
			$(".subject_list").hover(function(){
				clearInterval(timer_subject);
			},
			function(){
				timer_subject = setInterval(function(){
					teamIndex++;
					if(teamIndex==teamCount-2){
						$(".subject_list").stop().css("left","0px");
						teamIndex=1;					
					} 
					showteam(teamIndex);
				},2000);
			})
			$(".subject_list").mouseleave();
			
			//二维码放大效果
			$(".footer_top dl").find("img").hover(function(){
				$(this).css("zIndex","100").stop(true,false).animate({"width":"220px","height":"230px","z-index":"100"},500);
			},function(){
				$(this).css("zIndex","auto").stop(true,false).animate({"width":"100px","height":"110px","z-index":"0"},500);
			})
		})		
	</script>

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值