// WOW动画 if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) { new WOW().init(); }; // 首页轮播图 var upsSwiper = new Swiper('#banner .swiper-container', { longSwipes: false, loop: true, pagination: { el: '.pagination1', clickable: true, } }); swiperHeight = upsSwiper.height // 首页产品 var indexProductSwiper = new Swiper('.index-product-list', { slidesPerView: 2,//一行显示2个 slidesPerColumn: 2,//显示2行 autoplay: true, loop: false, pagination: { el: '.pagination_product', clickable: true, }, }); // 首页方案 var solutionSwiper = new Swiper('.solution-swiper', { slidesPerView: 1, autoplay: true, loop: true, pagination: { el: '.pagination2', clickable: true, }, }); // 首页荣誉 var honorSwiper = new Swiper('.index-honor-list', { slidesPerView: 2, slidesPerGroup: 2, autoplay: true, loop: true, pagination: { el: '.pagination3', clickable: true, }, }); // 首页新闻选项 var newsTabSwiper = new Swiper('.index-news-swiper', { effect : 'fade', speed: 500, on: { slideChangeTransitionStart: function() { $(".index-news-cate .on").removeClass('on'); $(".index-news-cate li").eq(this.activeIndex).addClass('on'); } } }) $(".index-news-cate li").on('click', function(e) { e.preventDefault() $(".index-news-cate .on").removeClass('on') $(this).addClass('on') newsTabSwiper.slideTo($(this).index()) }) var useProduct = new Swiper('.sw-product', { slidesPerView: 2, slidesPerGroup: 2, autoplay: true, loop: true, pagination: { el: '.pagination-use', clickable: true, } }); var picProduct = new Swiper('.product-pic-swiper', { slidesPerView: 1, slidesPerGroup: 1, autoplay: true, loop: true, pagination: { el: '.pagination-product', clickable: true, }, navigation: { nextEl: '.common-next', prevEl: '.common-prev', } }); // var scrollSwiper3 = new Swiper('.scroll-cont3', { // direction: 'vertical', // slidesPerView: 4, // slidesPerColumn: 3, // spaceBetween: 0, // autoplay: true, // }); // 列表荣誉 // var honorInnerSwiper = new Swiper('.inner-honor-list', { // slidesPerView: 3, // slidesPerGroup: 3, // autoplay: true, // loop: false, // pagination: { // el: '.pagination4', // clickable: true, // }, // }); // 客服 $(function(){ $('.fixed-right li').eq(1).hover(function(){ $(this).stop(true,true).animate({width:'85px',marginLeft:'-13px'},300); },function(){ $(this).stop(true,true).animate({width:'56px',marginLeft:'0px'},300); }) $('.fixed-right li.top').hover(function(){ $(this).stop(true,true).animate({width:'85px',marginLeft:'-13px'},300); },function(){ $(this).stop(true,true).animate({width:'56px',marginLeft:'0px'},300); }) $('.fixed-right li').eq(3).hover(function(){ $(this).stop(true,true).animate({width:'213px',marginLeft:'-155px'},500); },function(){ $(this).stop(true,true).animate({width:'213px',marginLeft:'0px'},500); }) $('.fixed-right li:first').hover(function(){ $(this).stop(true,true).animate({width:'85px',marginLeft:'-13px'},300,function(){$('.weixin img').stop().show()}); },function(){ $(this).stop(true,true).animate({width:'56px',marginLeft:'0px'},300,function(){$('.weixin img').stop().hide()}); }) $('.fixed-right li').eq(2).hover(function(){ $(this).stop(true,true).animate({width:'85px',marginLeft:'-13px'},300); },function(){ $(this).stop(true,true).animate({width:'56px',marginLeft:'0px'},300); }) $('.fixed-right li.top').on('click',function(){ $('html,body').stop().animate({scrollTop:0},1000) }) $('header nav li').hover(function(){ $(this).find('.con').fadeIn().stop().animate({top:70,opacity:1},300) },function(){ $(this).find('.con').fadeOut(0).stop().animate({top:80,opacity:0},0) }) }) $(function() { // 底部滑动框 // setTimeout(function() { // $('.asideBanner').eq(0).animate({ // bottom: '0px' // }, 1000) // }, 1000) $('.asideBanner .close-btn').eq(0).click(function() { $('.asideBanner').eq(0).animate({ left: -2000 }, 0, 500, 'linear'); $('.zhankai').animate({ left: 0 }, 0, 500, 'linear'); $('.foot-fast').css("height", '0'); $('.know-more').removeClass('on'); }) $('.zhankai').click(function() { $('.asideBanner').eq(0).animate({ left: 0 }, 0, 500, 'linear'); $('.zhankai').animate({ left: -200 }, 0, 500, 'linear'); }) $('.know-more').hover(function() { // if (!$(this).hasClass('on')) { // $(this).addClass('on'); // var ffHeight = $('.foot-fast .item').outerHeight(); // $('.foot-fast').css("height", ffHeight); // } else { // $(this).removeClass('on'); // $('.foot-fast').css("height", '0'); // } $(this).addClass('on'); var ffHeight = $('.foot-fast .item').outerHeight(); $('.foot-fast').css("height", ffHeight); }) $('.foot-fast').mouseleave(function(){ $('.know-more').removeClass('on'); $('.foot-fast').css("height", '0'); }) $('.foot-sub').click(function(){ var url = "/index.php?g=Contents&m=Index&a=searchselect", selOneVal = $('.foot-sel1').val(), selTwoVal = $('.foot-sel2').val(); if (selOneVal == "请选择您要的类型" || selTwoVal == "请选择您要检测的气体") { alert("请选择类型与气体名称!") } else { var goUrl = url + "&type_a=" + selOneVal + "&type_b=" + selTwoVal; window.location.href=goUrl; } }) // if ($('.index-product').length > 0) { // console.log('yes'); // var topIndexProduct = $(".index-product").offset().top; // $(document).scroll(function(e){ // if($(document).scrollTop()>topIndexProduct){ // $('.kefuBox').eq(0).animate({ // right: '-220px' // }, 500) // $('.kefuOpen').eq(0).animate({ // right: '0' // }, 500) // return false; // } // }); // } // if ($('.header-wrap').length > 0) { setTimeout(function() { $('.kefuBox').eq(0).animate({ right: '-220px' }, 500) $('.kefuOpen').eq(0).animate({ right: '0' }, 500) }, 800) // } // 右侧咨询框 $('.kefuBox .kefuClose').eq(0).click(function() { $('.kefuBox').animate({ right: -220 }, 0, 500, 'linear'); $('.kefuOpen').animate({ right: 0 }, 0, 500, 'linear'); }) $('.kefuOpen').click(function() { $('.kefuBox').eq(0).animate({ right: 0 }, 0, 500, 'linear'); $('.kefuOpen').animate({ right: -150 }, 0, 500, 'linear'); }) })