//大图 var bannerswiper = new Swiper('.banner-imgbox', { autoplay: { delay: 5000, disableOnInteraction: false, }, loop: true, autoHeight: true, navigation: { nextEl: '.next', prevEl: '.prev', }, slidesPerView: 1, pagination: { el: '.swiper-pagination', clickable: true, } }); $(document).ready(function () { //导航on效果 $(".nav>li>a").each(function () { if ($(this)[0].href="=" String(window.location)) { $(this).addClass("on").siblings().removeClass("on"); } }); // 导航下拉 $(".nav>li").hover(function () { $(".nav>li>dl").slideUp(600); if ($(this).find("dl").is(":hidden")) { $(this).find("dl").slideDown(600) } else { $(this).find("dl").slideUp(600) } }) //导航定位 $(window).scroll(function () { var topheight = $(".topbox").outerHeight(); var headerheight = $(".header").outerHeight(); var scrollTopheight = topheight + headerheight; if ($(this).scrollTop() > scrollTopheight) { $("nav").css("position", "fixed"); } else { $("nav").css("position", "relative"); } }) // 产品两层下拉 $(".about_ul>li").click(function () { $(".about_ul>li>dl").slideUp(600); if ($(this).find("dl").is(":hidden")) { $(this).find("dl").slideDown(600) } else { $(this).find("dl").slideUp(600) } }) //案例展示 var caseswiper = new Swiper('.case-imgbox', { autoplay: { delay: 5000, disableOnInteraction: false, },//自动滚动 loop: true, //循环滚动 navigation: { nextEl: '.case-next', prevEl: '.case-prev', },//箭头 slidesPerView: 4, //个数 spaceBetween: 14, //间距 }); });