/* Editor: fan Time: 2021.11.5 */ // 'use strict'; new WOW().init(); //缃《 function goTop() { $('html,body').animate({ 'scrollTop': 0 }, 1000); } var fhwbox3nav = new Swiper('.fhwbox3_nav',{ slidesPerView : 'auto', // 鏍规嵁slide鐨勫搴﹁嚜鍔ㄨ皟鏁村睍绀烘暟閲忋€傛鏃堕渶瑕佽缃畇lide鐨勫搴︼紝濡備笅style鎵€绀 freeMode: true, watchSlidesVisibility: true, watchSlidesProgress: true, }); var fhwbox3cont = new Swiper('.fhwbox3_cont', { spaceBetween: 10, thumbs: { swiper: fhwbox3nav } }); var fwid = new Swiper('.f_wid', { simulateTouch : false,//绂佹榧犳爣妯℃嫙 speed: 900, effect : 'fade', autoHeight: true, //楂樺害闅忓唴瀹瑰彉鍖 fadeEffect: { crossFade: true, }, on: { slideChangeTransitionStart: function(){ // alert(this.activeIndex); $("#c-special2 .c-list-wrap .c-list3 li").eq(this.activeIndex).addClass("on").siblings().removeClass("on"); }, }, }); // 鍗$偣 function stickyTab2(obj, aLi1, aLi2, aLi3) { if (obj.length != 0) { var num = obj.find(".c-list-wrap").outerHeight(); if ($(window).width() > 1199) { fn1(); num = obj.find(".c-list-wrap").outerHeight(); $(window).scroll(function() { fn1(); }); if (aLi3 != undefined) { aLi3.each(function() { $(this).click(function() { $("html,body").animate({ scrollTop: aLi1.eq($(this).index()).offset().top - ($(window).height() - aLi1.eq($(this).index()).outerHeight()) / 2 }, 500); }); }); } } else { // fn2(); num = obj.find(".c-list-wrap").outerHeight(); $(window).scroll(function() { // fn2(); }); if (aLi3 != undefined) { aLi3.each(function() { $(this).click(function() { $(this).addClass("on").siblings().removeClass("on"); aLi2.eq($(this).index()).addClass("on").siblings().removeClass("on"); fwid.slideTo($(this).index()); // $("html,body").animate({ scrollTop: aLi1.eq($(this).index()).offset().top - num + 30 }, 500); }); }); } } var _wi = $("#c-special2 > .basecont").width()-$("#c-special2 .c-list1").width(); var _lt = $("#c-special2 > .basecont").offset().left+$("#c-special2 .c-list1").width(); function fn1() { aLi1.each(function() { if ($(window).scrollTop() >= $(this).offset().top - $(window).height() / 2) { if (aLi2 != undefined) { fwid.slideTo($(this).index()); aLi2.eq($(this).index()).addClass("on").siblings().removeClass("on"); } if (aLi3 != undefined) { aLi3.eq($(this).index()).addClass("on").siblings().removeClass("on"); } } else if ($(window).scrollTop() < aLi1.eq(0).offset().top) { if (aLi2 != undefined) { fwid.slideTo(0); aLi2.eq(0).addClass("on").siblings().removeClass("on"); } if (aLi3 != undefined) { aLi3.eq(0).addClass("on").siblings().removeClass("on"); } } }); if ($(window).scrollTop() < obj.offset().top) { obj.find(".c-list-wrap").css({ "position": "relative", "width": _wi+"px", "left": "0", "bottom": "inherit", "top":"0" }); } if ($(window).scrollTop() > obj.offset().top) { obj.find(".c-list-wrap").css({ "position": "fixed", "width": _wi+"px", "left": _lt + "px", "bottom": "inherit", "top":"0" }); } if ($(window).scrollTop() > obj.offset().top + obj.outerHeight() - num) { obj.find(".c-list-wrap").css({ "position": "absolute", "width": _wi+"px", "left": "48%", "bottom": "0", "top":"inherit" }); } } // function fn2() { // aLi1.each(function() { // if ($(window).scrollTop() >= $(this).offset().top - num - 30) { // if (aLi2 != undefined) { // aLi2.eq($(this).index()).addClass("on").siblings().removeClass("on"); // } // if (aLi3 != undefined) { // aLi3.eq($(this).index()).addClass("on").siblings().removeClass("on"); // } // } else if ($(window).scrollTop() < aLi1.eq(0).offset().top) { // if (aLi2 != undefined) { // aLi2.eq(0).addClass("on").siblings().removeClass("on"); // } // if (aLi3 != undefined) { // aLi3.eq(0).addClass("on").siblings().removeClass("on"); // } // } // }); // if ($(window).scrollTop() < obj.offset().top) { // obj.find(".c-list-wrap").css({ // "position": "relative", // "top": "0", // "bottom": "auto", // "padding": "60px 0" // }); // } // if ($(window).scrollTop() > obj.offset().top) { // obj.find(".c-list-wrap").css({ // "position": "fixed", // "top": "0", // "bottom": "auto", // "padding": "60px 20px" // }); // } // if ($(window).scrollTop() > obj.offset().top + obj.outerHeight() - num) { // obj.find(".c-list-wrap").css({ // "position": "absolute", // "top": "auto", // "bottom": "0", // "padding": "60px 20px" // }); // } // } } }; window.onload=function(){ stickyTab2($("#c-special2"), $("#c-special2 .c-list1 li"), $("#c-special2 .c-list2 li"), $("#c-special2 .c-list3 li")); }