(function ($) { $(function () { var hisCount=0; var getHisSize=$(".dev_index_l_box li").length; $(".dev_index_r ul").each(function (i) { // toggleMasonry(i); }) $(window).resize(function (){ if (true) { //phone init start $(".dev_index").addClass("phone_dev"); try{ var mySwiper2 = new Swiper('#swiper-container2', { watchSlidesProgress: true, watchSlidesVisibility: true, slidesPerView: 7, prevButton:'.but a.prev', nextButton:'.but a.next', breakpoints: { //褰撳搴﹀皬浜庣瓑浜?20 768: { slidesPerView: 3, }, }, onTap: function () { mySwiper3.slideTo(mySwiper2.clickedIndex); }, }) var mySwiper3 = new Swiper('#swiper-container3', { autoHeight: true, // onInit: function(swiper){ // $("#swiper-container3 .swiper-wrapper").css("height","auto") // }, onSlideChangeStart: function () { updateNavPosition(); } }) function updateNavPosition() { $('#swiper-container2 .active-nav').removeClass('active-nav') var activeNav = $('#swiper-container2 .swiper-slide').eq(mySwiper3.activeIndex).addClass('active-nav'); if (!activeNav.hasClass('swiper-slide-visible')) { if (activeNav.index() > mySwiper2.activeIndex) { var thumbsPerNav = Math.floor(mySwiper2.width / activeNav.width()) - 1 mySwiper2.slideTo(activeNav.index() - thumbsPerNav) } else { mySwiper2.slideTo(activeNav.index()) } } } } catch (e) { } //phone init end } // else { // //pc init start // $(".dev_index").removeClass("phone_dev"); // //alert($(".dev_index_r").offset().top); // try{ // if ($(window).scrollTop() > $(".dev_index_r").offset().top) { // var getLeftPosition2 = $(window).scrollTop() - $(".dev_index_r").offset().top + 20; // var getComparePosition2 = $(".dev_index_r").height() - $(".dev_index_l").height(); // if (getLeftPosition2 >= getComparePosition2) { // //$(".dev_index_l").css({ "opacity": 1, "left": $(".dev_index").offset().left, "top": $(".dev_index_r").offset().top }); // $(".dev_index_l").css({ "top": getComparePosition2 - 40, "position": "absolute", "left": 0 }); // //$(".dev_index_l").css({ "opacity": 1, "left": $(".dev_index").offset().left, "top": $(".dev_index_l").height()*-1 }); // } else { // //$(".dev_index_l").css({ "opacity": 1, "left": $(".dev_index").offset().left, "top": $(".dev_index_r").offset().top }); // //$(".dev_index_l").stop().animate({ "top": getLeftPosition }, "fast"); // $(".dev_index_l").css({ "opacity": 1, "left": $(".dev_index").offset().left, "top": 138, "position": "fixed" }); // } // } else { // $(".dev_index_l").css({ "opacity": 1, "top": 0, "position": "absolute", "left": 0 }); // } // } catch (e) { } // //pc init end // } }) $(window).resize(); $(".dev_index_l_top").click(function(){ if(hisCount<=1){ $(".dev_index_l_top").addClass("disabled"); }else{ $(".dev_index_l_top").removeClass("disabled"); $(".dev_index_l_bottom").removeClass("disabled"); } if(hisCount<=0){ }else{ hisCount--; if ($(window).width()<1024) { //phone } else { $("body,html").stop().animate({ scrollTop: $(".dev_index_r_box > .dev_index_r_part:eq(" + hisCount + ")").offset().top-108 }, 600); devGetPosition(hisCount); } } }) $(".dev_index_l_bottom").click(function(){ if(hisCount>=getHisSize-2){ $(".dev_index_l_bottom").addClass("disabled"); }else{ $(".dev_index_l_top").removeClass("disabled"); $(".dev_index_l_bottom").removeClass("disabled"); } if(hisCount>=getHisSize-1){ }else{ hisCount++; if ($(window).width()<1024) { //phone } else { $("body,html").stop().animate({ scrollTop: $(".dev_index_r_box > .dev_index_r_part:eq(" + hisCount + ")").offset().top-108 }, 600); devGetPosition(hisCount); } } }) function devGetPosition(nIndex) { var getLeftLiHeight = $(".dev_index_l_wrap li:eq(0)").height(); var getSize = $(".dev_index_l_wrap li span").size(); if (nIndex > 1 && nIndex < getSize - 3) { $(".dev_index_l_box ul").stop().animate({ "top": nIndex * getLeftLiHeight * -1 + getLeftLiHeight * 2 }); } else if (nIndex >= getSize - 3) { $(".dev_index_l_box ul").stop().animate({ "top": getLeftLiHeight * getSize * -1 + getLeftLiHeight * 5 }); } else if (nIndex <= 1) { $(".dev_index_l_box ul").stop().animate({ "top": 0 }); } if(nIndex>=getHisSize-1){ $(".dev_index_l_bottom").addClass("disabled"); }else if(nIndex<=0){ $(".dev_index_l_top").addClass("disabled"); }else{ $(".dev_index_l_top").removeClass("disabled"); $(".dev_index_l_bottom").removeClass("disabled"); } } function devFunction() { $(".dev_index_l_wrap li span").click(function () { var nIndex = $(".dev_index_l_wrap li span").index(this); if ($(window).width()<1024) { //phone //$(".dev_index_l_box li:eq(" + nIndex + ")").addClass("active").siblings().removeClass("active"); //$("body,html").stop().animate({ scrollTop: $(".dev_index_r > .dev_index_r_part:eq(" + nIndex + ")").offset().top - 120 }, 600); //mySwiper.slideTo(nIndex, 1000, false); } else { $("body,html").stop().animate({ scrollTop: $(".dev_index_r_box > .dev_index_r_part:eq(" + nIndex + ")").offset().top-108 }, 600); devGetPosition(nIndex); hisCount=nIndex; } if(nIndex>=getHisSize-1){ $(".dev_index_l_bottom").addClass("disabled"); }else if(nIndex<=0){ $(".dev_index_l_top").addClass("disabled"); }else{ $(".dev_index_l_top").removeClass("disabled"); $(".dev_index_l_bottom").removeClass("disabled"); } }) $(window).scroll(function () { if ($(window).width()<1024) { //phone scroll start if ($(window).scrollTop() > $(".dev_index").offset().top) { //$(".phone_dev").addClass("dev_fixed"); } else { //$(".phone_dev").removeClass("dev_fixed"); } //phone scroll end } else { //pc scroll start if ($(window).scrollTop() > $(".dev_index_r").offset().top) { var getLeftPosition = $(window).scrollTop() - $(".dev_index_r").offset().top + 20; var getComparePosition = $(".dev_index_r").height() - $(".dev_index_l").height(); if (getLeftPosition >= getComparePosition) { //$(".dev_index_l").css({ "opacity": 1, "left": $(".dev_index").offset().left, "top": $(".dev_index_r").offset().top }); $(".dev_index_l").css({ "top": getComparePosition - 40, "position": "absolute","left":0 }); //$(".dev_index_l").css({ "opacity": 1, "left": $(".dev_index").offset().left, "top": $(".dev_index_l").height()*-1 }); } else { //$(".dev_index_l").css({ "opacity": 1, "left": $(".dev_index").offset().left, "top": $(".dev_index_r").offset().top }); //$(".dev_index_l").stop().animate({ "top": getLeftPosition }, "fast"); $(".dev_index_l").css({ "opacity": 1, "left": $(".dev_index").offset().left, "top": 138,"position":"fixed" }); } } else { $(".dev_index_l").css({ "opacity": 1, "top": 0, "position": "absolute", "left": 0 }); } //pc scroll end } try { $(".dev_index_r h4").each(function (i) { if ($(window).width()<1024) { if ($(window).scrollTop() >= $(".dev_index_r_box > .dev_index_r_part:eq(" + i + ")").offset().top - 120) { //$(".dev_index_l_box li:eq(" + i + ")").addClass("active").siblings().removeClass("active"); } else { //$(".dev_index_l_box li:eq(" + i + ")").addClass("active").siblings().removeClass("active"); } } else { if ($(window).scrollTop() >= $(".dev_index_r_box > .dev_index_r_part:eq(" + i + ")").offset().top-20-300) { //pc $(".dev_index_l_box li:eq(" + i + ")").addClass("active").siblings().removeClass("active"); devGetPosition(i); hisCount=i; } else { } } }) } catch (e) { } }) } function toggleMasonry(i) { $('#U' + i).imagesLoaded(function () { $('#U' + i).masonry({ itemSelector: 'li' }); $(".dev_index_r li").each(function () { try { if ($(this).position().left != 0) { $(this).addClass("odd"); } } catch (e) { } }) devFunction(); $(window).scroll(); }) } }) })(jQuery); $(function(){ downButInt(); }) function downButInt(){ $('#slide_down').on('click',function(){ var _height=$('.video-banner').outerHeight(true); $('html,body').animate({scrollTop: _height}, 700); }) }