$(function() { if(typeof swiper != 'undefined') { var indexswiper = new swiper('.banner', { paginationclickable: true, loop: true, speed: 1200, autoplay: { delay: 6000 }, pagination: { el: '.banner .index-dot', clickable: true, }, navigation: { nextel: '.banner .banner-right', prevel: '.banner .banner-left', }, autoplaydisableoninteraction: false, simulatetouch: false, }); var smallswiper = new swiper('.small-list', { paginationclickable: true, autoplay: false, speed: 1200, slidesperview: 3, spacebetween: 26, //loop: true, autoplaydisableoninteraction: false, simulatetouch: false, navigation: { nextel: '.small-wraper .product-right', prevel: '.small-wraper .product-left', } }); var bigswiper = new swiper('.biglist', { paginationclickable: true, //loop: true, speed: 1200, pagination: { el: '.biglist .index-dot', clickable: true, }, autoplaydisableoninteraction: false, simulatetouch: false, }); $(".small-list ul li").each(function() { $(this).click(function() { bigswiper.slideto($(this).index(), 300); }) }) $(".m-list-style").each(function() { var listswiper = $(this).find(".m-list-swiper"); var listleft = $(this).find(".banner-left"); var listright = $(this).find(".banner-right"); var listdot=$(this).find(".index-dot"); var videoswiper = new swiper(listswiper, { paginationclickable: true, autoplay: true, loop: true, speed: 1200, slidesperview: 3, spacebetween: 46, autoplaydisableoninteraction: true, simulatetouch: true, navigation: { nextel: listright, prevel: listleft, }, pagination: { el:listdot, clickable: true, }, breakpoints: { 992: { slidesperview: 2, spacebetween: 22, }, 640: { slidesperview: 1, spacebetween: 10, }, }, }); }); //首页 $(".indexpro-box").each(function(){ var proswiper=$(this).find(".index-productsiwper"); var carleft=$(this).find(".carousel-left"); var carright=$(this).find(".carousel-right"); var dot=$(this).find(".index-dot"); var indexproswiper = new swiper(proswiper, { paginationclickable: true, autoplay: true, speed: 1200, slidesperview: 4, spacebetween: 10, loop: true, autoplaydisableoninteraction: true, simulatetouch: true, observer: true, observeparents: true, pagination: { el:dot, clickable: true, }, navigation: { nextel:carright, prevel: carleft, }, breakpoints: { 992: { slidesperview: 2, }, 640: { slidesperview: 1, spacebetween: 0, }, }, }) }); $(".mproduct-nav a:eq(0)").addclass("cur"); $(".index-swiper-item .indexpro-box:eq(0)").show(); $(".mproduct-nav a").each(function(index) { $(this).click(function() { // indexproswiper.update(); $(this).addclass("cur").siblings().removeclass("cur"); $(".index-swiper-item .indexpro-box").eq(index).show().siblings().hide(); }) }); //首页解决方案 var videoswiper = new swiper(".insolutions-swiper", { paginationclickable: true, autoplay: true, loop: true, speed: 1200, slidesperview: 3, spacebetween:38, autoplaydisableoninteraction: true, simulatetouch: true, pagination: { el:'.insolutions-swiper .index-dot', clickable: true, }, navigation: { nextel: '.insolutions-swiper .carousel-right', prevel:'.insolutions-swiper .carousel-left', }, breakpoints: { 1024: { slidesperview: 2, spacebetween: 16, }, 640: { slidesperview: 1, spacebetween: 10, }, }, }); } //三级导航 $(".sub-item .a1").click(function() { if($(this).next().is(":hidden")) { $(".three-nav").slideup(); $(this).next().slidedown(300); } else { $(".three-nav").slideup(); } }) //判断导航是否有二级 $("nav ul li").each(function() { var htmltext = $(this).find(".sub-nav"); if(htmltext.length == 0) { $(this).find(".arrorright-btn").remove(); } }); //视频播放 var host = location.protocol + '//' + location.host; var videoobject = { container: '#videobox1', //容器的id或classname variable: 'player', //播放函数名称 autoplay: true, //是否自动播放 debug: true, //是否开启调试模式 drag: 'start', //拖动的属性 seek: 0, //默认跳转的时间 playbackrate: -1, mobileckcontrols: false }; // palybtn function ckplayerx($showbtn, $hidebtn) { var player; $(document).on('click', $showbtn, function() { $(".recruitmentfloat").fadein(300); _videofile = $(this).attr('rel'); videoobject.video = _videofile; player = new ckplayer(videoobject); }) $(document).on('click', $hidebtn, function() { player.videopause() $('.recruitmentfloat').fadeout(300); $(".recruitmentfloat .videobox").html(""); }); } ckplayerx('.video-swiper ul li', '.recclosebtn'); //单图弹窗 if(typeof swiper != 'undefined') { function honorslide($horigin) { var $thumb = $horigin.find('img'); var $thumbswiper = $(".product-popup .swiper-wrapper").html(''); //空 var slide_length = $thumb.length; for(var i = 0; i < slide_length; i++) { var $item = $('
  • ' + '
  • '); $thumbswiper.append($item); } } //弹窗轮播 var proswiper = new swiper(".prodcutpop-swiper", { paginationclickable: true, simulatetouch: false, roundlengths: true, observer: true, observeparents: true, navigation: { nextel: '.procut-right', prevel: '.procut-left', } }); $(".support-video ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".latestcase-list ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".latestcase-list1 ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".latestcase-list2 ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".latestcase-list3 ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".latestcase-list4 ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".latestcase-list5 ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".latestcase-list6 ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".latestcase-list7 ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".latestcase-list8 ul li").click(function () { var num = $(this).index(); honorslide($('.latestcase-list')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".product-case ul li").click(function () { var num = $(this).index(); honorslide($('.product-case')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".product-images ul li").click(function () { var num = $(this).index(); honorslide($('.product-images')); proswiper.slideto(num, 0); $(".product-popup,.probg").fadein(300); }); $(".closebtn").click(function() { $(".prodcutpop-swiper .swiper-wrapper").html(''); $(".probg").fadeout(300); $(".product-popup").fadeout(300); }); } $(".product-navbox ul li:eq(0)").addclass("cur"); $(".product-warp .m-box-list:eq(0)").show(); $(".product-navbox ul li").each(function(index) { $(this).click(function() { $(this).addclass("cur").siblings().removeclass("cur"); $(".product-warp .m-box-list").eq(index).show().siblings().hide(); }) }); $(".check-icon").click(function() { if($(this).parents(".sign-text").hasclass("cur")) { $(this).parents(".sign-text").removeclass("cur"); } else { $(this).parents(".sign-text").addclass("cur"); } }); //产品需求 $(".loadcolosebtn").click(function(){ $(".loadpopup").fadeout(); }) $(".commonproblem ul li").eq(0).addclass("cur"); $(".commonproblemcontent").eq(0).show(); $(document).on("click", ".commonproblem ul li h3", function() { if($(this).next().is(":hidden")) { $(".commonproblemcontent").slideup(300); $(".commonproblem li").removeclass("cur"); $(this).parents("li").addclass("cur"); $(this).next().slidedown(300); } else { $(this).parents("li").removeclass("cur"); $(this).next().slideup(300); } }); $(".m-list-style").each(function () { if ($(this).find("ul li").length == 0) { $(this).hide(); } }) judescreen(); $(window).resize(function() { judescreen(); }); //取消事件冒泡 function stoppropagation(e) { // 如果提供了事件对象,则这是一个非ie浏览器 if(e && e.stoppropagation) { // 因此它支持w3c的stoppropagation()方法 e.stoppropagation(); } else { // 否则,我们需要使用ie的方式来取消事件冒泡 window.event.cancelbubble = true; } } $(".search-box .search-icon").click(function() { event.stoppropagation(); if($(this).parents(".search-box").find(".search-form").is(":hidden")) { $(".search-form").stop(true, true).slidedown(300); } else { $(".search-form").slideup(); } }); $(".search-box").click(function() { event.stoppropagation(); }) $(".mob-search").click(function() { $(".header-right").hide(); if($(".mob-search-form").is(":hidden")) { $(".mob-search-form").stop(true, true).slidedown(300); } else { $(".mob-search-form").slideup(); } }); var backtop = $("a.sidetop"); var wint = $(window).scrolltop(); $(window).on('scroll', function () { wint = $(window).scrolltop(); if (wint <= 400) { backtop.fadeout(300); }; if (wint > 400) { backtop.fadein(300); }; }); backtop.on('click', function () { $("html,body").stop(false, true).animate({ "scrolltop": 0 }, 500); return false; }); //点空白处关闭 $(document).click(function() { $(".search-form").hide(); }); $(".productdeatils-two table").each(function () { $(this).wrap("
    ") }) function judescreen() { if($(window).width() >= 1024) { //1024 $(".sub-nav").hide(); $("nav ul li").off("mouseenter mouseleave").hover(function() { $(".sub-nav").stop(true, true).slideup(); $(this).find(".sub-nav").stop(true, true).slidedown(300); }, function() { $(this).find(".sub-nav").hide(); }); //底部 $(".footer-subnav,.header-right").show(); //地图 $(".address-con").hide(); $(".address-list li").off("mouseenter mouseleave").hover(function() { $(this).addclass("active"); $(this).find(".address-con").stop(true, true).fadein(300) }, function() { $(this).removeclass("active"); $(this).find(".address-con").stop(true, true).fadeout(300) }) } else { //<1024 $(".weixin").off("mouseenter mouseleave"); //移动端展开下拉 $(".mobnav-btn").off("click").on("click", function() { $(".mob-search-form").hide(); if($(".header-right").is(":hidden")) { $(this).addclass("g_close"); $(".header-right").slidedown(300); } else { $(".header-right").slideup(); $(this).removeclass("g_close"); } }); //移动端二级导航 $(".sub-nav").hide(); $("nav ul li h4").off("click").on("click", function() { if($(this).parents("li").find(".sub-nav").is(":hidden")) { $(this).parents("li").find(".sub-nav").slidedown().parents("li").siblings().find(".sub-nav").slideup(); $(this).parents("li").addclass("active").siblings().removeclass("active"); } else { $(this).parents("li").find(".sub-nav").slideup(); $(this).parents("li").removeclass("active"); } }); $(".weixin").off("click").on("click", function() { if($(this).find(".code-box").is(":hidden")) { $(".code-box").hide(); $(this).find(".code-box").fadein(300); } else { $(this).find(".code-box").hide(); } }) //底部 $(".footer-subnav").hide(); $(".footer-left li h4").off("click").on("click", function() { if($(this).next().is(":hidden")) { $(".footer-subnav").slideup(300); $(".footer-left li h4").removeclass("cur"); $(this).addclass("cur"); $(this).next().slidedown(300); } else { $(this).removeclass("cur"); $(this).next().slideup(300); } }); //地图 $(".address-con").show(); } } })