$(function() {
    $('.science-gather-box li').hover(function() {
        $(this).find('.gather-hide-item').fadeIn()
        $(this).find('.gather-box-bot').fadeOut()
    }, function() {
        $('.gather-hide-item').fadeOut()
        $(this).find('.gather-box-bot').fadeIn()
    })
    var imgUrlBase = $('.img-url-box').attr('data-url')
    var scienceData = [
        {
            title: imgUrlBase+'/images/polymerization/hi4/icon_xny_mb.png',
            desc: '全球首创智能四驱电混技术Hi4',
            url: '/nev.html'
        },
        {
            title: imgUrlBase+'/images/polymerization/hi4/icon_tkpt_mb.png',
            desc: '全球化智能专业越野平台',
            url: '/tank.html'
        },
        {
            title: imgUrlBase+'/images/polymerization/hi4/icon_kfzn_mb.png',
            desc: '让汽车成为会思考能判断、可持续生长的未来出行伙伴，重构人与车的关系',
            url: '/smartcoffee.html'
        }
    ]
    setTimeout(function() {
        var swiper1 = new Swiper('.swiper-science', {
            spaceBetween: 0,
            slidesPerView: 1.5,
            centeredSlides: true,
            loopedSlides: 2,
            loop: true,
            navigation: {
                nextEl: '.terrace-next',
                prevEl: '.terrace-prev',
            },
            on: {
                init: function() {
                    $('.swiper-science').css('opacity', '1')
                },
                slideChangeTransitionEnd: function(data){
                    $('.gather-text-img').attr('src', scienceData[this.realIndex].title)
                    $('.gather-text-p').text(scienceData[this.realIndex].desc)
                    $('.gather-text-url').attr('href', scienceData[this.realIndex].url)
                },
            }
        })
    }, 300)
})