<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>