$(function() { $("header nav a.home").addClass("active"); var kv_slider = new Swiper('.kv .swiper-container', { autoplay: { delay: 7000, disableOnInteraction: false, }, loop: true, pagination: { el: '.kv .dot', clickable: true, }, on:{ init: function(){ $(".kv .box .txt_body h1").hide().removeClass("animated fadeInUp"); $(".kv .box .txt_body h2").hide().removeClass("animated fadeInUp"); $(".kv .box .txt_body a.more").hide().removeClass("animated fadeInUp"); setTimeout(function(){ $(".kv .swiper-slide-active .box .txt_body").find("h1").show().addClass("animated fadeInUp"); },600); setTimeout(function(){ $(".kv .swiper-slide-active .box .txt_body").find("h2").show().addClass("animated fadeInUp"); },1000); setTimeout(function(){ $(".kv .swiper-slide-active .box .txt_body").find("a.more").show().addClass("animated fadeInUp"); },1400); }, slideChangeTransitionEnd: function(){ $(".kv .box .txt_body h1").hide().removeClass("animated fadeInUp"); $(".kv .box .txt_body h2").hide().removeClass("animated fadeInUp"); $(".kv .box .txt_body a.more").hide().removeClass("animated fadeInUp"); setTimeout(function(){ $(".kv .swiper-slide-active .box .txt_body").find("h1").show().addClass("animated fadeInUp"); },600); setTimeout(function(){ $(".kv .swiper-slide-active .box .txt_body").find("h2").show().addClass("animated fadeInUp"); },1000); setTimeout(function(){ $(".kv .swiper-slide-active .box .txt_body").find("a.more").show().addClass("animated fadeInUp"); },1400); } } }); var kvnum = $(".kv .dot span").length; if(kvnum <= 1) { $(".kv .dot").hide(); $(".kv .swiper-container .swiper-slide").addClass("swiper-no-swiping"); kv_slider.autoplay.stop(); } setTimeout(function(){ $(".kv .swiper-slide-active .box .txt_body").find("h1").show().addClass("animated fadeInUp"); },600); setTimeout(function(){ $(".kv .swiper-slide-active .box .txt_body").find("h2").show().addClass("animated fadeInUp"); },1000); setTimeout(function(){ $(".kv .swiper-slide-active .box .txt_body").find("a.more").show().addClass("animated fadeInUp"); },1400); //图片资源列表 let srcs=[]; /*let srcs=[ {img:"http://zhentai.irealdemo.com:88/public/upload/20210204/20210204121038.jpg",tit:"从源头到排放的全程水务自动化信息化解决方案",text:"为水行业近500家企业提供了自动化、信息化产品和解决方案,涵括水利、供水、排水,实现每一滴水从取用到排放的全程监控,水务信息化平台贯通各环节的系统控制和生产运营,为水资源监测、生态改善、安全用水提供智慧化管理。",link:"/solution/Additionally.html"}, {img:"http://zhentai.irealdemo.com:88/public/upload/20210204/20210204121038.jpg",tit:"从源头到排放的全程水务自动化信息化解决方案",text:"为水行业近500家企业提供了自动化、信息化产品和解决方案,涵括水利、供水、排水,实现每一滴水从取用到排放的全程监控,水务信息化平台贯通各环节的系统控制和生产运营,为水资源监测、生态改善、安全用水提供智慧化管理。",link:"/solution/Additionally.html"}, {img:"http://zhentai.irealdemo.com:88/public/upload/20210204/20210204121038.jpg",tit:"从源头到排放的全程水务自动化信息化解决方案",text:"为水行业近500家企业提供了自动化、信息化产品和解决方案,涵括水利、供水、排水,实现每一滴水从取用到排放的全程监控,水务信息化平台贯通各环节的系统控制和生产运营,为水资源监测、生态改善、安全用水提供智慧化管理。",link:"/solution/Additionally.html"}, {img:"http://zhentai.irealdemo.com:88/public/upload/20210204/20210204121038.jpg",tit:"从源头到排放的全程水务自动化信息化解决方案",text:"为水行业近500家企业提供了自动化、信息化产品和解决方案,涵括水利、供水、排水,实现每一滴水从取用到排放的全程监控,水务信息化平台贯通各环节的系统控制和生产运营,为水资源监测、生态改善、安全用水提供智慧化管理。",link:"/solution/Additionally.html"}, ]*/ //图片容器节点列表 let imgList = [] //当前位置 let currentIndex = 0 //操作按钮 let slideLeft = document.getElementById("slideLeft"),slideRight = document.getElementById("slideRight") //指示点节点列表 let handlerList = [] //文字节点列表 let textList = [] window.onload = function(){ slideLeft.addEventListener("click",function(e){ if(currentIndex <= 0)return; setCurrentIndex(currentIndex-1); }) slideRight.addEventListener("click",function(e){ if(currentIndex >= imgList.length-1)return; setCurrentIndex(currentIndex+1); }) } function init(index){//通过图片列表添加对应的轮播节点,并初始化位置 let imgListContainer = document.getElementById("imgListContainer") let handlerListContainer = document.getElementById("handlerListContainer") let textListContainer = document.getElementById("textListContainer") for(let i=0;i<=srcs.length-1;i++){ let src = srcs[i] //添加图片节点 let div = document.createElement("div") div.setAttribute("id","img"+i) div.className = "imgContainer "+(i==index?"slide-active":i==index+1?"slide-next":i' imgListContainer.appendChild(div) imgList.push(div) //添加指示器节点 let handler = document.createElement("div") handler.className = "handler "+(i==index?"active":"") handler.addEventListener("click",function(e){ if(currentIndex == i)return; setCurrentIndex(i) }) handlerListContainer.appendChild(handler) handlerList.push(handler) //添加文字节点 let text = document.createElement("div") text.setAttribute("id","text"+i) text.className = "textContainer "+(i==index?"slide-active":i

'+src.text+'

立即探索' textListContainer.appendChild(text) textList.push(text) var len = $("#handlerListContainer .handler").length; if (len <=1) { $("#handlerListContainer").hide(); $("#imgListContainer .slideBtn").hide(); }else{ $("#handlerListContainer").show(); $("#imgListContainer .slideBtn").show(); } } currentIndex = index } $(".solution .solu_tab ul li").click(function(){ var index = $(".solution .solu_tab ul li").index($(this)); $(".solution .solu_tab ul li").removeClass("active").eq(index).addClass("active"); $(".solution .con_list .solu_con").stop(false,true); $(".solution .con_list .solu_con").hide().eq(0).fadeIn(); //$(".solution .con_list .solu_con").hide().eq(index).fadeIn(); //lih var cid=$(this).attr('cid'); $.ajax({ type: "POST", url: "/index.php/index/index/get_solution_list.html", data: "cid=" + cid, cache: false, success: function(data) { $("#textListContainer .textContainer").remove(); $("#handlerListContainer .handler").remove(); $("#imgListContainer .imgContainer").remove(); srcs = data; //图片容器节点列表 imgList = [] //当前位置 currentIndex = 0 //操作按钮 slideLeft = document.getElementById("slideLeft"),slideRight = document.getElementById("slideRight") //指示点节点列表 handlerList = [] //文字节点列表 textList = [] init(0);//初始化,将初始位置设为0 // // slideLeft.addEventListener("click",function(e){ // if(currentIndex <= 0)return; // setCurrentIndex(currentIndex-1); // }) // slideRight.addEventListener("click",function(e){ // if(currentIndex >= imgList.length-1)return; // setCurrentIndex(currentIndex+1); // }) } }) //end lih $("#handlerListContainer").change(function(){ }); }).eq(0).click(); function setCurrentIndex(index){//位置变化时,修改节点样式 if(index>= imgList.length)return; for(let i=0;iindex+1){item.className = "imgContainer slide-after"} } for(let i=0;iindex){item.className = "textContainer slide-after"} } slideLeft.className = index==0?"slideBtn hide":"slideBtn"; slideRight.className = index==imgList.length-1?"slideBtn hide":"slideBtn"; handlerList.forEach(function(handler,i){ handler.className= "handler "+(i==index?"active":"") }) currentIndex = index; } $(".product .content .list .box_list .box").hover(function(){ $(".product .content .list .box_list .box .mask").stop(false,true); $(this).find(".mask").slideDown(); },function(){ $(".product .content .list .box_list .box .mask").stop(false,true); $(this).find(".mask").slideUp(); }); var about_slider = new Swiper('.about .slider_rt .swiper-container', { effect:"fade", fadeEffect: { crossFade: true, }, autoplay: { delay: 2000, disableOnInteraction:true, }, observer:true, observeParents:true, pagination: { el: '.about .slider_rt .dot', clickable: true, }, }); });