$(document).ready(function($) { setimg(); $(window).resize(function(event) { setimg(); }); $(".banner").slide({maincell:".bd",effect:"fold",autoplay:true,delaytime:1000,intertime:5000}); //$(".case-banner").slide({maincell:".bd",autopage:true,effect:"leftloop",autoplay:true,vis:3}); $(".solution-tab").slide({maincell:".bd",autopage:true,effect:"leftloop",autoplay:true,vis:3}); /*营销网络*/ var pro = $(".provice li"); var box = $(".map .box"); box.hide(); pro.hover(function() { $(this).addclass("on") var index = pro.index($(this)); box.hide().eq(index).show(); }, function() { $(this).removeclass("on") }); box.mouseleave(function(event) { box.hide(); }); /*联系我们*/ $(".company-info .addr-info").click(function(event) { var x = $(this).attr("x"); var y = $(this).attr("y"); var name = $(this).attr("name"); var address = $(this).attr("address"); var postcode = $(this).attr("postcode"); var phone = $(this).attr("phone"); var faxes = $(this).attr("faxes"); var mail = $(this).attr("mail"); baidumap(x,y,phone,address,name,postcode,faxes,mail); }); /*电子报*/ var img = $(".paper-img img"); var page = $(".pagelist li"); var news = $(".paper-con .paper-con-list"); page.click(function(event) { var index = page.index($(this)); page.removeclass("on").eq(index).addclass("on"); news.hide().eq(index).show(); img.hide().eq(index).show(); $(".paper-img .page-title span").text($(this).text()); }); img.click(function(event) { var big = $(this).attr("big"); $(".img-box").html(""); $(".layout,.img-box").show(); }); $(".img-box").on("click",function(event) { $(".layout,.img-box").hide(); }); /*发展历程*/ if($(".years").length > 0){ if (typeof(document.body.style.maxheight)) { $(".years").mcustomscrollbar({ horizontalscroll:true }); } } var year = $(".years-list li"); var events = $(".event-wrap .event"); year.click(function(event) { var index = year.index($(this)); year.removeclass("on").eq(index).addclass("on"); events.hide().eq(index).show(); }); /*展厅*/ $(".m_show_ul .m_show_li").hover(function() { $(this).addclass("on"); }, function() { $(this).removeclass("on"); }); $(".m_r_elect_list_ul li").hover(function() { $(this).find(".text").hide(); $(this).find(".hover").show(); }, function() { $(this).find(".text").show(); $(this).find(".hover").hide(); }); /*tab切换*/ var tabli = $(".tab-con a"); var maincon = $(".tab-main .main-con"); tabli.click(function(event) { event.preventdefault(); var index = tabli.index($(this)); tabli.removeclass("s_e_d_active").eq(index).addclass("s_e_d_active"); maincon.hide().eq(index).show(); }); /*切导航切换*/ $(".sub_nav").click(function(event) { event.preventdefault(); $(this).next().slidetoggle(); }); //表格颜色每行颜色交换 $('.electricinner .div2 table tr:odd').addclass('c') //发展历程 2015-01-20 $('.develop-wrap .event-wrap >div:not(:first)').hide(); }); function setimg(){ var $width = $(document.body).width(); var $height = $(document.body).height(); var boxwidth = $(".img-box").width(); $(".img-box").css("left",($width-boxwidth)/2+"px"); } $(function(){ $(".honor-show-div ul li").hover(function(){ $(this).addclass("active"); $(this).find(".honer-medal").show(); },function(){ $(this).removeclass("active"); $(this).find(".honer-medal").hide(); }) }) //判断li的数量,控制动画是否执行 $(function(){ var number1 =$('.show-zt-1 li').size(); if( number1 <=3 ){ $('.prev-1').hide(); $('.next-1').hide(); }else{ $('.prev-1').show(); $('.next-1').show(); $(".case-banner-1").slide({maincell:".bd",autopage:true,effect:"leftloop",autoplay:true,vis:3}); }; var number2 =$('.show-zt-2 li').size(); if( number2 <=3 ){ $('.prev-2').hide(); $('.next-2').hide(); }else{ $('.prev-2').show(); $('.next-2').show(); $(".case-banner-2").slide({maincell:".bd",autopage:true,effect:"leftloop",autoplay:true,vis:3}); }; var number3 =$('.show-zt-3 li').size(); if( number3 <=3 ){ $('.prev-3').hide(); $('.next-3').hide(); }else{ $('.prev-3').show(); $('.next-3').show(); $(".case-banner-3").slide({maincell:".bd",autopage:true,effect:"leftloop",autoplay:true,vis:3}); }; $('.paper-con .paper-con-list li a').click( function(){ $('.bzbox').show(); }) $('.bzbox .return').click(function(){ $('.bzbox').hide(); }) })