function isMobile() { var userAgentInfo = navigator.userAgent; var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var mobile_flag = false; //根据userAgent判断是否是手机 for (var v = 0; v < mobileAgents.length; v++) { if (userAgentInfo.indexOf(mobileAgents[v]) > 0) { mobile_flag = true; break; } } var screen_width = window.screen.width; //根据屏幕分辨率判断是否是手机 if (screen_width < 992) { mobile_flag = true; } return mobile_flag; } new WOW().init(); var banSwiper = new Swiper('.banner .swiper-container', { speed: 500, loop: true, autoplay: true, pagination: { el: '.banner .swiper-pagination', clickable: true, }, }) var protabContainer = new Swiper('#protabContainer', { speed: 500, autoHeight: true, on: { slideChangeTransitionStart: function() { $(".tabpro .on").removeClass('on'); $(".tabpro li").eq(this.activeIndex).addClass('on'); } } }) $(".tabpro li").on('click', function(e) { e.preventDefault() $(".tabpro .on").removeClass('on') $(this).addClass('on') protabContainer.slideTo($(this).index()) }) var idxNewSwiper = new Swiper('#idxNewSwiper', { breakpoints: { //当宽度大于等于320 320: { spaceBetween: 25, slidesPerView: 1.5, }, 750: { slidesPerView: 3, spaceBetween:20, allowTouchMove: false, }, 1240: { slidesPerView: 3, spaceBetween: 40, allowTouchMove: false, } }, }) $(window).on('scroll', function () { if ($(window).scrollTop() > 250) { $(".page-aside").addClass("show") } else { $(".page-aside").removeClass("show") } }); $(".j-gotop").click((function () { $("html, body").animate({ scrollTop: 0 }, 400) })) if (!isMobile()) { } else { $('nav li .iconfont').click(function(){ $(this).parent().children('dl').slideToggle( ); $(this).toggleClass('up') ; }) } $('.h_nav').click(function (e) { $("nav").toggleClass('show') ; $(this).toggleClass('close') ; }) $('.proLeft dl').click(function (e) { $(this).toggleClass('on').siblings().removeClass('on'); }); /* $('.proLeft .an').click(function (e) { $(this).parent().parent().find("ul").slideToggle(200).parent().siblings().find("ul").slideUp(200); $(this).toggleClass('icon-minus-bold') ; }); $('.proLeft dt').click(function (e) { console.log('dd') $(this).parent().find("ul").slideToggle(200); $(this).parent().siblings().find("ul").slideUp(200) console.log() // $(this).parent().find("ul").slideToggle(200).parent().parent().parent().siblings().find("ul").slideUp(200) ; $(this).parent().toggleClass('on') ; $(this).parent().siblings().removeClass('on') });*/ $('.researchtabtit li').click(function(){ var index = $(this).index(); $(this).addClass('on').siblings().removeClass('on'); $('.researchtabCon figure').removeClass('on').eq(index).addClass('on'); }) var newTopswiper = new Swiper('#newTopswiper', { loop:true, pagination: { el: '#newTopswiper .swiper-pagination', clickable: true, }, }) var menuItem = document.querySelectorAll('.menuItem') var topBtn = document.querySelectorAll('.topBtn') for(let j=0;j