// 页头搜索框点击事件 $(".header_search_box .shanchu").click(function(){ $(".header_search_box input").val(""); }) let shou = true; $(".header_search .search").click(function(){ if(shou){ $(".header_search .search img").attr("src","/template/default/images/index/tou/sousuo.png"); $(".header_search .search img").css("width","25%"); $(".header_search .search").addClass("search_cha"); $(".header_search_box").stop().slideDown(300,function(){ $(".header_search_box").css("display","block"); }) shou = false; }else{ $(".header_search .search").removeClass("search_cha"); $(".header_search .search img").attr("src","/template/default/images/index/tou/search2.png"); $(".header_search .search img").css("width","100%"); $(".header_search_box").stop().slideUp(300,function(){ $(".header_search_box").css("display","none"); $(".header_search_box input").val(""); }) shou = true; } }) // 页头轮播图 let swiper1 = new Swiper('#swiper1',{ // grabCursor : true,// 触摸变成手掌 // autoplay: 2000, speed:1000, // 速度 loop : true, // 让Swiper看起来是循环的 pagination : '.swiper-pagination', paginationClickable :true, noSwipingClass : 'stop-swiping', }); //鼠标覆盖停止自动切换 $("#swiper1").mouseenter(function(){ swiper1.stopAutoplay(); }); //鼠标离开开始自动切换 $("#swiper1").mouseleave(function(){ swiper1.startAutoplay(); }); // 页头面包屑下滑 let bol = true; $(".header_menu").click(function(){ if(bol){ $(".header_nav").stop().slideDown(300,function(){ $(".header_nav").css("display","block"); }); bol = false; }else{ $(".header_nav").stop().slideUp(300,function(){ $(".header_nav").css("display","none"); }); bol = true; } }); // 页头二次菜单 $(".header_nav>li").mouseenter(function(){ $($(this)[0].children[1]).stop().slideDown(300); }); $(".header_nav>li").mouseleave(function(){ $($(this)[0].children[1]).stop().slideUp(300); }); // 时间轴 var p = $('.abolc-dot').width(), n = -50; $(".abolc-ldot .abolc-dotline").css("left",p + "px"); $(".abolc-rdot .abolc-dotline").css("left",n + "px"); var timerShaft = new Swiper('.abolc-time .swiper-container', { speed: 400, slidesPerView: 1, slidesPerGroup : 1, spaceBetween : 0, centeredSlides: true, slideToClickedSlide:true, prevButton: '.abolc-prev', nextButton: '.abolc-next', onSlideChangeStart: function(swiper){ comTeamMove(swiper.activeIndex,timerShaft,timerWords); } }); $(".abolc-ldot .abolc-dotck").bind("click",function(){timerShaft.slideTo($(this).index())}); $(".abolc-rdot .abolc-dotck").bind("click",function(){timerShaft.slideTo($(this).index())}); function comTeamMove(index,timerShaft,timerWords){ $(".abolc-ldot .abolc-dotline").stop().animate({left: (3 - index) * 50}, 300); $(".abolc-rdot .abolc-dotline").stop().animate({left: (-1 - index) * 50}, 300); if($(window).width()<1000){ $(".abolc-ldot .abolc-dotline").stop().animate({left: (2 - index) * 50}, 300); $(".abolc-rdot .abolc-dotline").stop().animate({left: (-1 - index) * 50}, 300); } if($(window).width()<640){ $(".abolc-ldot .abolc-dotline").stop().animate({left: (1 - index) * 50}, 300); $(".abolc-rdot .abolc-dotline").stop().animate({left: (-1 - index) * 50}, 300); } timerWords.slideTo(index);timerShaft.slideTo(index); } var timerWords = new Swiper('.abolc-wdbox .swiper-container', {speed: 0}); // over // 置顶 $(".sideBar-wrapper .backTop").click(function () { $("html,body").animate({ scrollTop: "0px" }, 800) }); $(".yqlj").mouseenter(function(){ $(".yqlj-box").show(); }) $(".yqlj").mouseleave(function(){ $(".yqlj-box").hide(); }) // 页面body 添加类名 监听事件 bodyChange(); function bodyChange(){ if ($(window).width() <= 1000) {$("body").removeClass("winter");}else{$("body").addClass("winter");} } widthChange(); function widthChange(){ var window_width = $(window).width();//获取浏览器窗口宽度 // 超出设备提示 if (!!window.ActiveXObject || "ActiveXObject" in window){return false;} var rberMe = sessionStorage['rberMe'] || ''; if( window_width >= 2000 && rberMe==''){ sessionStorage['rberMe'] = 'www.yisiy.com'; var wthint = "您的显示设备已超出设计范围!为了布局美观,采取居中排版!确定吗?"; if (window.confirm(wthint)) {sessionStorage['rberMe'] = 'winter';$("body").addClass("body-maxwidth");} else{return;} } if(rberMe=='winter') {$("body").addClass("body-maxwidth");} } // 判断是否为IE浏览器 // if (!!window.ActiveXObject || "ActiveXObject" in window){alert("当前为IE浏览器,部分效果和样式不兼容!请更换浏览器,欣赏更佳!");} //浏览器窗口事件 $(window).resize(function () {widthChange();bodyChange();});