const wW=$(window).width(); //内页菜单 调用封装 line横条 $('.nymenu .box').$line("left","click"); // $('.nymenu').$scrollH('.nymenu',"menuH"); //产品中心card选项卡 $(".product-tab ul li:nth-child(1)").addClass("active");//给每个集合 第一个元素active样式 $(".tabCon .content:nth-child(1)").addClass("active");//给每个集合 第一个元素active样式 /*$('.product-tab').$line("top","hover");*/ $(".product-tab ul li").hover(function(){ $($($(this).parent('ul')).parent(".product-tab").children("ul")).children("li").eq($(this).index()).addClass("active").siblings().removeClass("active"); $($(this).parent('ul')).parent(".product-tab").next(".tabCon").children("div.content").removeClass("active").eq($(this).index()).addClass("active"); }); //产品360全景点击开启 const pro360Start=$(".r360 .r360-start"); pro360Start.click(function(){ $(this).css("zIndex","0"); $(this).css("opacity","0"); }); //产品亮点 元素点击显示隐藏 function fourli(){ const profourli=$(".provfour li"); profourli.click(function(){ var profourli_on=$(this).is(".active"); if(profourli_on){ $(this).removeClass('active'); $(this).children(".desc").slideUp(); }else{ $(this).addClass('active').siblings().removeClass('active'); $(this).children(".desc").slideDown().parent().siblings().children(".desc").slideUp(); } }); } //产品规格 var cpggswiper = new Swiper("#cpggswiper", {/*列表页*/ slidesPerView: 'auto', spaceBetween: 20, breakpoints:{ 768:{ spaceBetween: 10, } }, navigation: { nextEl: ".cpggswiper-next", prevEl: ".cpggswiper-prev", } }); $("#cpggswiper .swiper-slide").click(function(){ $(this).addClass('on').siblings().removeClass('on'); $($($($($(this).parent('.swiper-wrapper')).parent(".cpgglist")).parent('.box')).next('.toggle')).children(".cont").eq($(this).index()).addClass("active").siblings().removeClass("active"); }); //产品视频点击播放 $('.provvideo .video').$video(".provvideo .video .ico",".provvideo .video .ico i",".provvideo .video video",1,0); //产品应用领域下拉 const form2li=$(".pro-form2 li"); const formtext=$('.pro-form2 .text'); //点击弹出下拉框 formtext.click(function() { $(this).toggleClass('on'); var is_fromon=formtext.is(".on"); if(is_fromon){ $(this).next("ul").slideDown(); $(document).bind("click",function(e){ var target = $(e.target); if(target.closest(".pro-form2 .text").length == 0){ $(".pro-form2 .text").removeClass("on"); $(".pro-form2 ul").slideUp(); }; e.stopPropagation(); }) }else{ $(this).next("ul").slideUp(); } }); //研发团队 点击展开 const bbonea=$(".backbone li .text .link a"); bbonea.click(function(){ const is_bbli=$($($(this).parent('.link').parent('.text')).parent('li')).is(".active"); if(is_bbli){ $($($(this).parent('.link').parent('.text')).parent('li')).removeClass("active") }else{ $($($(this).parent('.link').parent('.text')).parent('li')).eq($(this).index()).addClass("active").siblings().removeClass("active"); } }) //控制系统 调用封装 line横条 $('.system-top').$line("left","click"); $('.system-top li').click(function() { $(this).addClass("active").siblings().removeClass('active'); //内容切换 $($($($($(this).parent("ul")).parent(".system-top")).next(".system-info")).children(".w1400")).children(".cont").eq($(this).index()).addClass("active").siblings().removeClass("active"); }); //三角背景 function trianglebg(){ const trianglebg=$(".trianglebg"); const trianglebgW=trianglebg.parent('.triangle').width()*0.8; const trianglebgH=trianglebg.parent('.triangle').height()*0.45; trianglebg.css("border-right-width",trianglebgW); trianglebg.css("border-left-width",trianglebgH); trianglebg.css("border-top-width",trianglebgH); } trianglebg();//三角背景调用 if(wW<768){ fourli();//产品亮点点击事件调用 function proTab(){//产品展示页tab高度 var m_protabH=$(".tabCon .content"); var is_proTab=m_protabH.is(".active"); if(is_proTab){ $.each(m_protabH,function(){ var proTabH=$(this).height(); $(this).parent(".tabCon").css("height",proTabH); }); } }; proTab(); } $(window).resize(function(){//窗口大小改变时执行 trianglebg();//产品视频三角背景调用 if(wW<768){ fourli();//产品亮点点击事件调用 } }); //解决方案 var swiper = new Swiper('.center-slide .swiper-container', {/*展示页*/ slidesPerView: 3, centeredSlides: true, loop: true, autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: true, }, pagination: { el: '.swiper-pagination', clickable: true, }, }); var swiper = new Swiper("#txtpicslide0", {/*列表页*/ slidesPerView: 3, pagination:false, navigation: { nextEl: ".txtpicslide0-next", prevEl: ".txtpicslide0-prev", }, }); var swiper = new Swiper("#txtpicslide1", {/*列表页*/ slidesPerView: 3, pagination:false, navigation: { nextEl: ".txtpicslide1-next", prevEl: ".txtpicslide1-prev", }, }); var baseswiper = new Swiper("#baseslide", {/*列表页*/ autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: true, }, navigation: { nextEl: ".baseslide-next", prevEl: ".baseslide-prev", }, }); if(wW>768){ var yeaswiper = new Swiper(".yearswiper", { direction: "vertical", slidesPerView: 8, pagination: false, navigation: { nextEl: ".yearswiper-next", prevEl: ".yearswiper-prev", }, }); $(".yearswiper .swiper-slide").click(function() { $(this).addClass('on').siblings().removeClass('on'); $($(this).parent(".swiper-wrapper").next(".yearsinfo")).children(".toggle").eq($(this).index()).addClass("on").siblings().removeClass("on"); //触边自动显示 var t3d=$(".yearswiper .swiper-wrapper").css("transform"); var strt3d=t3d.replace(")",'').split(","); var numst3d=Number(strt3d[strt3d.length-1]);//获取已移动距离 var thisH=$(this).height();//获取单个元素 高度 var parH=$(".yearswiper .swiper-wrapper").height();//获取外部dom高度 var otherH=parH - thisH;//计算距离外部dom距离 var toH=parseFloat($(this)[0].offsetTop);//获取距离顶部高度 if((toH + numst3d)>=otherH){ yeaswiper.slideNext(); } if(numst3d>0){}else{ if((toH + numst3d)==0){ yeaswiper.slidePrev(); } } }); }else{ var yeaswiper = new Swiper(".yearswiper", { slidesPerView: "auto", pagination: false, navigation: { nextEl: ".yearswiper-next", prevEl: ".yearswiper-prev", }, }); $(".yearswiper .swiper-slide").click(function() { $(this).addClass('on').siblings().removeClass('on'); $($(this).parent(".swiper-wrapper").next(".yearsinfo")).children(".toggle").eq($(this).index()).addClass("on").siblings().removeClass("on"); }); //内页子导航下拉 $('.nymenu .box').click(function() { var is_on=$(this).is('.on'); if(is_on){ $(this).removeClass('on'); $(this).children('ul').slideUp(); }else{ $(this).addClass('on'); $(this).children('ul').slideDown(); } $(document).bind("click",function(e){ var target = $(e.target); if(target.closest(".nymenu .box").length == 0){ $('.nymenu .box').removeClass('on'); $('.nymenu .box ul').slideUp(); } e.stopPropagation(); }) }); $('.nymenu .box ul li').click(function() { var this_text=$(this).text(); var is_submenu=$('.nymenu .box').find('.submenu').length; console.log(is_submenu); if(is_submenu){ $('.nymenu .box .submenu').text(this_text); }else{ $('.nymenu .box').append(''); } }); } var fwlcswiper = new Swiper("#fwlclist", {/*列表页*/ preventClicks:true, slidesPerView: 4, breakpoints:{ 1024:{ slidesPerView: 3 }, 768:{ slidesPerView: 2 }, 414:{ slidesPerView: 1 } }, navigation: { nextEl: ".fwlc-next", prevEl: ".fwlc-prev", }, on: { slideChangeTransitionEnd: function(){ var sfwnum=5; if(wW<1025){ var sfwnum=4; } var fwi=this.activeIndex + 1; var fwilast=this.activeIndex + sfwnum; $(".fwslide .swiper-wrapper>div .fwnext").css("opacity","1"); $(".fwslide .swiper-wrapper>div:nth-child(" + fwi + ") .fwnext").css("opacity","0"); $(".fwslide .swiper-wrapper>div:nth-child(" + fwilast + ") .fwnext").css("opacity","0"); } } }); var solistswiper = new Swiper("#solistslide", {/*列表页*/ preventClicks:true, slidesPerView: 3, breakpoints:{ 768:{ slidesPerView: 1 } }, pagination: { el: ".solistslide-page", type: 'fraction', }, navigation: { nextEl: ".solistslide-next", prevEl: ".solistslide-prev", } }); var solists2swiper = new Swiper("#solistslide2", {/*列表页*/ preventClicks:true, slidesPerView: 4, breakpoints:{ 768:{ slidesPerView: 2 } }, pagination: { el: ".solistslide2-page", type: 'fraction', }, navigation: { nextEl: ".solistslide2-next", prevEl: ".solistslide2-prev", } }); var sswiper = new Swiper("#sslide", {/*列表页*/ preventClicks:true, slidesPerView: 4, breakpoints:{ 768:{ slidesPerView: 2 }, 414:{ slidesPerView: 1 }, }, navigation: { nextEl: ".sslide-next", prevEl: ".sslide-prev", } }); var abtswiper = new Swiper("#abtslide", {/*列表页*/ preventClicks:true, slidesPerView: 4, breakpoints:{ 768:{ slidesPerView: 2 } }, navigation: { nextEl: ".abtslide-next", prevEl: ".abtslide-prev", } }); $('.sovideo').$video(".sovideo .box",".sovideo .box .text ",".sovideo video",1,0); $('.pro_tab_menu').click(function() { $(this).toggleClass('on'); var is_on=$(this).is('.on'); if(is_on){ $(this).next('ul').slideDown(); }else{ $(this).removeClass('on'); $(this).next('ul').slideUp(); } $(document).bind("click",function(e){ var target = $(e.target); if(target.closest(".pro_tab_menu").length == 0){ $('.pro_tab_menu').removeClass('on'); $('.pro_tab_menu').next('ul').slideUp(); } e.stopPropagation(); }) }); $('.product-tab ul li').click(function() { var this_text=$(this).html(); var is_submenu=$('.product-tab').find('.pro_tab_menu').length; console.log(is_submenu); if(is_submenu){ $('.pro_tab_menu').html(this_text); }else{ $('.product-tab').append('
'+ this_text +'
'); } }); //视频列表点击播放 $(".videolist .toggle li").click(function() { var videourl=$(this).attr("url"); var videopic= $("#cavideopic"); var videoplay= $("#cavideoplay"); videoplay.prev(".img").hide(); //状态获取 $(this).addClass('active').siblings().removeClass('active'); $(this).addClass('on').siblings().removeClass('on'); //赋值给video视频 和封面地址 videoplay.attr("src",videourl); videoplay.css("zIndex","1"); $(".videolist .box .video .img").hide(); videoplay[0].play(); videoplay.bind("ended",function(){/*播放完成*/ videoplay.css("zIndex","0"); $('.videolist .box .video .img').show(); }); }); //案例简介视频播放 //$('.sovideo').$video(".sovideo .box",".sovideo .box .text ","#sovideoplay",1,0); $(".ltrv .video .text").click(function() { var videoplay= $(".ltrv .video video"); //状态获取 $(this).addClass('on').siblings().removeClass('on'); videoplay.css("zIndex","1"); videoplay[0].play(); videoplay.bind("ended",function(){/*播放完成*/ videoplay.css("zIndex","0"); }); }); //服务平台 //我要报修 $(".mhbx li").click(function() { $(this).addClass('on').siblings().removeClass('on'); $(this).children(".desc").slideDown().parent().siblings().children(".desc").slideUp(); $(this).parent("ul").parent(".text").next(".img").children("ul").children("li").eq($(this).index()).addClass("on").siblings().removeClass("on"); }); //投诉建议 $(".tsdiv").click(function() { $(this).parent(".tsxl").toggleClass('on'); var ts_is=$(this).parent(".tsxl").is(".on"); if(ts_is){ $(this).parent(".tsxl").children("ul").slideDown(); $(document).bind("click",function(e){ var target = $(e.target); if(target.closest(".childipt").length == 0){ $(".childipt").removeClass("on"); $(".tstj .tsxl ul").slideUp(); }; e.stopPropagation(); }) }else{ $(this).parent(".tsxl").children("ul").slideUp(); } }); //赋值 $(".tstj .tsxl li span").click(function() { var thissort=$(this).text().replace(/(^\s*|\s*$)/g, ""); $(".tssort").text(thissort); $("#spsort").val(thissort); $(".tsxl ul").slideUp(); $(".tsxl").removeClass('on'); $(this).parent("li").parent("ul").parent(".childipt").addClass("active"); }); $(".tstj .tsxl li font").click(function() { var is_on=$(this).parent("li").is(".on"); if(is_on==true){ $(this).parent("li").removeClass('on'); $(this).parent("li").next(".ss").slideUp(); }else{ $(this).parent("li").addClass('on').siblings("li").removeClass('on'); $(this).parent("li").next(".ss").slideDown().siblings(".ss").slideUp(); } }); //联系我们 $(".sixlicard .cclick .cdown").click(function() { var sixlcli=$(this).parent(".cclick").parent(".text").parent("li"); sixlcli.addClass("on").siblings().removeClass("on"); }); $(".sixlicard .cclick .cup").click(function() { $(this).parent(".cclick").parent(".text").parent("li").removeClass("on"); }); $(".slinkbtn").click(function() { var slbis_on=$(this).is('.on'); if(slbis_on){ $(this).parent('.sixlink').parent('.sixlicard').addClass('active'); $(this).children('.lname2').hide(); $(this).children('.lname1').show(); $(this).removeClass('on'); }else{ $(this).parent('.sixlink').parent('.sixlicard').removeClass('active'); $(this).children('.lname1').hide(); $(this).children('.lname2').show(); $(this).addClass('on'); } }); //诚聘英才 $(".cont3 .title .csort font").click(function() { $(this).addClass("on").siblings().removeClass("on"); $($(this).parent(".csort").parent(".title").next(".fourpicslide").children(".csslide")).eq($(this).index()).addClass("on").siblings().removeClass("on"); }); //留言 $(".cform .cinput input").$input_on(".cform .cinput input",".cinput","on"); //投诉建议 $(".tstj .tsinput .ontsipt").$input_on(".tstj .tsinput .ontsipt",".childipt","active"); //关于我们新闻 var newvideobtn=$(".newsslide .box .video");/*播放视频*/ var newvideoplay= $("#nvideoplay"); $(".newsslide .box .video .text").click(function(){/*点击播放*/ newvideobtn.css("zIndex","2"); newvideoplay.css("zIndex","1"); newvideoplay[0].play(); }); newvideoplay.bind("ended",function(){/*播放完成*/ newvideobtn.css("zIndex","2"); newvideoplay.css("zIndex","-1"); });