/** * created by administrator on 14-10-22. */ //导航 var li = $(".header .nav>li"); li.mouseenter(function(){ $(this).children("ul").show(); }); li.mouseleave(function(){ $(this).children("ul").hide(); }); //banner图 $(function(){ var dongone = true; var liimg =$(".banner ul li"); var tempul = $(".banner ul"); var num = $(liimg).length; var foc = $(".banner .focus>div"); $(".banner").hover(function(){ dongone = false; $(".btn").show(); },function(){ dongone = true; $(".btn").hide(); }); var tempimg = new array(); for(var iii = 0;iii= num){i=-1} if(tempimg != undefined&&num > 1){ var html = tempimg[i+1]; tempul.children("li").eq(1).html(html); var li = tempul.children(":first").clone(); tempul.children(":first").animate({marginleft:"-1440px"},2000,function admin(){ li.appendto(tempul); tempul.children(":first").remove(); }); i++; if(i>=num){i = 0} foc.removeclass("current").eq(i).addclass("current"); } }},4000); // 点击向前 $(".btn .prev").click(function(){ if(i==-1||i==num-1){ k=0; i=-1 }else{ k= i+1 } var html = tempimg[k]; tempul.find("li").eq(1).html(html); var li = tempul.children(":first").clone(); tempul.children(":first").animate({marginleft:"-1440px"},1000,function admin(){ li.appendto(tempul); tempul.children(":first").remove(); }); i++; foc.removeclass("current").eq(i).addclass("current"); }); // 点击向后 $(".btn .next").click(function(){ i--; if(i<0){ m = num-1; i = num-1; }else{ m= i } var html = tempimg[m]; tempul.find("li").eq(1).html(html); var li = tempul.find("li").eq(1); tempul.css({marginleft:"-1440px"}); li.insertbefore(tempul.children(":first")); tempul.children(":first").animate({marginleft:"1440px"},1000,function admin(){ tempul.css({marginleft:"0px"}); tempul.children(":first").css({marginleft:"0px"}); }); foc.removeclass("current").eq(i).addclass("current"); }); // 原点点击调至相应图片 foc.click(function(){ j = $(this).index(); var html = tempimg[j]; tempul.find("li").eq(1).html(html); var li = tempul.children(":first").clone(); tempul.children(":first").animate({marginleft:"-1440px"},1000,function admin(){ li.appendto(tempul); tempul.children(":first").remove(); }); if(j==num){ i=-1 }else{ i=j } if(i==-1){ i=num } foc.removeclass("current").eq(i).addclass("current"); }); }); //友情链接 var link = $(".footer .sel"); link.mouseenter(function(){ $(this).children("ul").show(); }); link.mouseleave(function(){ $(this).children("ul").hide(); }); link.children("ul").children("li").click(function(){ link.children("span").html($(this).children("a").html()); $(this).parent().hide(); }); //微信 var col = $(".weix .col"); var sha = $(".weix .shao"); //关闭 col.click(function(){ $(".weix .wei").hide(); $(this).hide(); }); sha.click(function(){ col.show(); $(".weix .wei").show(); });