﻿//banenr切换
var swiper1 = new Swiper('.apple-banner .swiper-container', {      
        autoplay: 3000,//自动播放时间
        loop: true,//开启循环true or false
        slidesPerView: 1, //列数
        spaceBetween: 0, //slides之间间隔
        breakpointsInverse: true,
        nextButton: '.apple-banner .swiper-button-next',
        prevButton: '.apple-banner .swiper-button-prev',
        pagination: '.apple-banner .swiper-pagination',
		observer:true,
        observeParents:true,
        autoplayDisableOnInteraction:false,
		paginationClickable: true,
        breakpoints: {
            320: {
                slidesPerView: 1,
                spaceBetween: 0
            },
            767: {
                slidesPerView: 1,
                spaceBetween: 0
            },
            1080: {
                slidesPerView: 1,
                spaceBetween: 0
            },
            1200: {
                slidesPerView: 1,
                spaceBetween: 0
            }
        }
    });
	
/*产品目录 begin*/
/*产品目录第一个默认展开*/
$(function(){ $(".cp_type .bd ul li").first().children('div').show();$(".cp_type .bd ul li").first().addClass('on');});
$(".cp_type .bd ul li p span").click(function () {
	if($(this).parents('li').hasClass('on')){
		$(this).parents('li').removeClass('on').find('div').stop().slideUp();
	}else{
		$(this).parents('li').find('div').removeAttr("style");
		$(this).parents('li').addClass('on').find('div').stop().slideDown();
	}
});

if(document.body.clientWidth <=1079){  
	$(".cp_type .hd").click(function () {
		if($(this).hasClass('on')){
			$(this).next('div').removeAttr("style");
			$(this).removeClass('on').next('div').stop().slideUp();
		}else{
			$(this).next('div').removeAttr("style");
			$(this).addClass('on').next('div').stop().slideDown();
		}
	});
}	
/*产品目录 end*/

/*侧边漂浮*/
$(function() {
    var time;
    //var winHeight = top.window.document.body.clientHeight || $(window.parent).height();
    $('.client-2').css({
        'marginTop': -($('.client-2').height() / 2)
    });
    $('#client-2 li').bind({
        'mouseenter': function() {
            var scope = this;
            time = setTimeout(function() {
                var divDom = $(scope).children('div');
                var maxWidth = divDom.width();
                $(scope).stop().animate({
                    left: 77 - maxWidth
                },
                'normal',
                function() {
                    var pic = $(scope).find('.my-kefu-weixin-pic');
                    if (pic.length > 0) {
                        pic.show();
                    }
                });
            },
            100)
        },
        'mouseleave': function() {
            var pic = $(this).find('.my-kefu-weixin-pic');
            var divDom = $(this).children('div');
            var maxWidth = divDom.width();
            if (pic.length > 0) {
                pic.hide();
            }
            clearTimeout(time);
            var divDom = $(this).children('div');
            $(this).stop().animate({
                left: 0
            },
            "normal",
            function() {});
        }
    });
    //返回顶部
    $(window).scroll(function() {
        var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
        var eltop = $("#client-2").find(".my-kefu-ftop");
        if (scrollTop > 0) {
            eltop.show();
        } else {
            eltop.hide();
        }
    });
    $("#client-2").find(".my-kefu-ftop").click(function() {
        var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
        if (scrollTop > 0) {
            $("html,body").animate({
                scrollTop: 0
            },
            "slow");
        }
    });
});




//荣誉资质切换
var swiper3 = new Swiper('.swiper-container02', {		
		autoplay: 3000,//自动播放时间
		loop: true,//开启循环true or false
		slidesPerView: 3,//列数
		spaceBetween: 20,//slides之间间隔
		breakpointsInverse: true,
		nextButton: '.swiper-button-next',
		prevButton: '.swiper-button-prev',
		pagination: '.swiper-pagination',
		paginationClickable: true,
            observer:true,
            observeParents:true,
            autoplayDisableOnInteraction:false,
		breakpoints: {
			320: {
				slidesPerView: 1,
				spaceBetween: 10
			},
			767: {
				slidesPerView: 1,
				spaceBetween: 10
			},
			1080: {
				slidesPerView: 2,
				spaceBetween: 20
			},
			1200: {
				slidesPerView: 3,
				spaceBetween: 20
			}
		}
	});

/*首页新闻文章切换*/
$(".wxArt_Point a").hover(function(){
    $(this).addClass('on').siblings('a').removeClass('on');
	var h_honor_box_tab=$(this).index();
	$('.inwzbox .wxArt_Items').eq(h_honor_box_tab).show().siblings().hide();
},function(){
    
});
