$(document).ready(function() { var step = 0; var clik = false; var mySwiper; function myscroll(elem, boxWidth) { var timer = setInterval(function() { if (step >= 0 && boxWidth > 0 && step <= boxWidth) { step = step + 5; if (step <= boxWidth) { clik = true; } } else if (step >= 0 && boxWidth < 0) { step = step - 5; if (step <= Math.abs(boxWidth)) { clik = true; } } else if (step < 0) { step = 0; clik = false; clearInterval(timer); return; } else if (step >= boxWidth) { step = boxWidth; clik = false; clearInterval(timer); } $(elem).scrollLeft(step); }, 1) } $(document).on("click", function(e) { var e = e || window.event; var target = e.target || srcElement; var boxWidth = $(".banner_img>li").get(0).offsetWidth; if ($(target).hasClass("prev_btn") && clik == false) { myscroll(".banner_img", -boxWidth); } if ($(target).hasClass("next_btn") && clik == false) { myscroll(".banner_img", boxWidth); } if (!$(target).parents().hasClass("big_banner")) { $(".big_banner").removeClass("big_banner_show"); mySwiper = null; $(".banner").fadeIn(); } $(".more_text").fadeOut(); $(".create_time_text").removeClass("words_opacity2"); $(".words_opacity").removeClass("words_opacity"); // $(".toUp").removeClass("toUp"); $(".title_float_box").fadeOut(); $(".border_check").removeClass("border_check"); // $(".culture_create_bg_small").show().siblings(".culture_create_bg_big").hide(); // $(".image2_small").fadeIn().siblings(".image2_big").fadeOut(); $(".culture_create_bg_small").attr("src", "./images/culture/Development_Milestones.png"); $(".image2_small").attr("src", "./images/culture/02_Image_small.png"); }) $(".banner_img>li").on("click", function() { var index = $(this).index(); var _number = $(".max_1320").get(0).offsetHeight; var _headerHei = $(".header").get(0).offsetHeight; var _banerHei = _headerHei + _number; myswiper.value = index; $(".banner").fadeOut(); $(".big_banner").addClass("big_banner_show"); console.log(myswiper); setTimeout(function() { $(window).scrollTop(_banerHei); }, 5); mySwiper = new Swiper('.swiper-container', { initialSlide: myswiper.value, loop: false, autoplay: false, parallax: true, onSetTransition: function(swiper) { swiper.disableTouchControl(); }, // 濡傛灉闇€瑕佸墠杩涘悗閫€鎸夐挳 nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev', autoplayDisableOnInteraction: false, }); return false; }); $(".more_btn").on("click", function() { if (browserRedirect()) { $('.concept2 .img_mobile').css('height', '100%'); var index_mobile = $(this).parents(".create_time_text").index(); if (index_mobile == 0 || index_mobile == 1) { var changeIndex = index_mobile + 3; } $(".more_btn").removeClass("words_opacity"); $(this).addClass('words_opacity') $(".more_btn").siblings(".sim_text").removeClass("words_opacity"); $(this).siblings(".sim_text").addClass("words_opacity"); $(this).addClass("words_opacity"); // $(".big_banner_control_btn ").addClass("words_opacity"); $(".more_btn").siblings(".more_text").hide(); $(this).siblings(".more_text").show(); if (index_mobile != 2) { // $(".culture_create_bg_big").fadeIn().siblings(".culture_create_bg_small").fadeOut(); $(".culture_create_bg_small").attr("src", "./images/culture/Development_Milestonesd.png"); } // if (index >= 2) { // $(".create_time_text").eq(index).addClass("words_opacity2"); // } // $(".create_time_text").eq(index).siblings(".create_time_text").addClass("words_opacity"); return false; } else { var index = $(this).parents(".create_time_text").index(); if (index == 0 || index == 1) { var changeIndex = index + 3; if (!browserRedirect()) { $(".create_time_text").eq(changeIndex).addClass("words_opacity2"); } } $(this).siblings(".sim_text").addClass("words_opacity"); $(this).addClass("words_opacity"); // $(".big_banner_control_btn ").addClass("words_opacity"); $(this).siblings(".more_text").fadeIn(); if (index != 2) { // $(".culture_create_bg_big").fadeIn().siblings(".culture_create_bg_small").fadeOut(); $(".culture_create_bg_small").attr("src", "./images/culture/Development_Milestonesd.png"); } // if (index >= 2) { // $(".create_time_text").eq(index).addClass("words_opacity2"); // } // $(".create_time_text").eq(index).siblings(".create_time_text").addClass("words_opacity"); return false; } }); $(".titile_box_span").on("click", function() { var index = $(this).index(); $(this).addClass("border_check").siblings().removeClass("border_check"); $(".title_float_box ").eq(index).show().siblings(".title_float_box").hide(); // $(".title_box").addClass("toUp"); // $(".image2_big").fadeIn().siblings(".image2_small").fadeOut(); $(".image2_small").attr("src", "./images/culture/02_Image_big.png"); return false; }) var myswiper = { value: 0, }; // var mySwiper = })