// 轮播图
$('.banner').slick({
    'autoplay': true,
    'autoplaySpeed': 5000,
    'arrows':true,
    'dots':true,
    'touchMove':true,
    'fade':true,
    'infinite':true,
    'pauseOnHover':false
    
});

// 双玺产品
$('.pbox-main').slick({
    'slidesToShow': 4,
    'slidesToScroll':4,
    'autoplay': true,
    'autoplaySpeed': 5000,
    'arrows':true,
    'dots':true,
    'touchMove':true,
    'infinite':true,
    'pauseOnHover':true
});

setTimeout(function(){
    $('.adv-num').appear(function () {
        var content = $(this).text();
        var counter = parseInt($(this).text().replace(/,/g, ""));
        $(this).countTo({
            from: 1,
            to: counter,
            speed: 800,
            refreshInterval: 60,
            onComplete: function () {
                $(this).text(content);
            }
        });
    });
},200);

// 自动播放
var pindex = 0;
var pinter = setInterval(pshow,3000);

function pshow(){
    $('.adva-main').find('a').removeClass('active');
    $('.adva-main').find('a').eq(pindex).addClass('active');
    pindex = pindex + 1
    if(pindex == $('.adva-main').find('a').length){
        pindex = 0;
    }
}

$('.adva-main a').hover(function(){
    clearInterval(pinter);
},function(){
    $('.adva-main').find('a').removeClass('active');
    pinter = setInterval(pshow,3000);
});



new WOW().init();