$(function(){ $('.tab_head ul li').click(function(){ $(this).addClass("active").siblings().removeClass("active"); var index = $('.tab_head ul li').index($(this)); $('.tab_content ul li.tab_content_li').eq(index).show().siblings().hide(); }); $('.tab_head1 ul li').hover(function(){ $(this).addClass("active").siblings().removeClass("active"); var index = $('.tab_head1 ul li').index($(this)); $('.tab_content1 ul li.tab_content_li').eq(index).show().siblings().hide(); }); /*首页切换*/ $('.m5ul li').click(function(){ $(this).addClass("active").siblings().removeClass("active"); var index = $('.m5ul li').index($(this)); $('.m6ul li').eq(index).show().siblings().hide(); }); $("#gotop").click(function(){ $("html,body").animate({scrollTop:"0px"},400); }); //遍历bn $(".swiper-wrapper-bn .swiper-slide").each(function(){ var bg = $(this).find(".bnimg").data("background"); $(this).find(".bnimg").css({"background":'url('+bg+')'}) }); $(".whead i,.wapnavtop i").click(function(){ $(".wapnav").toggleClass("wapnav_active"); $(".wpnvbg").toggleClass("wpnvbg_active"); }) $(".wpnvbg").click(function(){ $(".wapnav").removeClass("wapnav_active"); $(".wpnvbg").removeClass("wpnvbg_active"); }) $(".wapprda").click(function(){ $(this).siblings(".wpheadhide").slideToggle(); }) $(".wapprda1").click(function(){ $(this).siblings(".wpheadhide1").slideToggle(); }) /*$(".fidbox_top").click(function(){ $("html,body").animate({scrollTop:"0px"},500); });*/ var swiper = new Swiper('.swiper-container-bn', { autoplay:true, navigation: { nextEl: '.swiper-button-next-bn', prevEl: '.swiper-button-prev-bn', }, //effect: 'fade', pagination: { el: '.swiper-pagination', clickable: true, }, loop: true, }); var swiper2 = new Swiper('.swiper-container-m2', { //loop: true, autoplay:true, navigation: { nextEl: '.swiper-button-next-m2', prevEl: '.swiper-button-prev-m2', }, }); var swiper3 = new Swiper('.swiper-container-m3', { autoplay:true, slidesPerView: 'auto', spaceBetween: 0, loop: true, navigation: { nextEl: '.swiper-button-next-m3', prevEl: '.swiper-button-prev-m3', }, }); // var swiper1 = new Swiper('.swiper-container-m1', { // autoplay:true, // speed:3000, //设置图片滚动速度 // slidesPerView: 'auto', // spaceBetween: 0, // loop: true, // navigation: { // nextEl: '.swiper-button-next-m1', // prevEl: '.swiper-button-prev-m1', // }, // }); // var swiper = new Swiper ('.swiper-container-m1', { loop : true, //允许从第一张到最后一张,或者从最后一张到第一张 循环属性 slidesPerView :5, // 设置显示三张 freeMode:true, // 使幻灯片滑动时不止滑动一格,且不会自动贴合 slidesPerGroup :1 , //定义1张图片为一组 speed:5000, //设置过度时间 grabCursor: true, //鼠标样式根据浏览器不同而定 slidesPerView: 'auto', preventLinksPropagation: false, // 阻止点击事件冒泡 navigation: { nextEl: '.swiper-button-next-m1', prevEl: '.swiper-button-prev-m1', }, autoplay : { delay:0, disableOnInteraction: true, } }); $('.swiper-button-next-m1').click(function(){ swiper.slideNext(); }); $('.swiper-button-prev-m1').click(function(){ swiper.slidePrev(); }); // var swiper4 = new Swiper('.swiper-container-m4', { // autoplay:true, // slidesPerView: 'auto', // spaceBetween: 0, // loop: true, // navigation: { // nextEl: '.swiper-button-next-m4', // prevEl: '.swiper-button-prev-m4', // }, // }); });