$(function () { $(".strategy_main .strategy_li_box").height($(".strategy_main .strategy_li_box").width() * 1.3); $(".strategy_main ul").css("height", $(".strategy_main .strategy_li_box").width() * 1.3 * 2); var ani_one = true; var ani_one_back = true; //��ҳҳ�涯�� function mwheelscroll() { try { if ($(window).scrolltop() >= ($(".strategy_main").offset().top + $(".strategy_main").height() - $(window).height()) - $(".strategy_main").height() / 2) { if (ani_one == true) { $(".strategy_main ul").addclass("addanimate"); ani_one = false; ani_one_back = true; } } if ($(window).scrolltop() < ($(".strategy_main").offset().top + $(".strategy_main").height() - $(window).height()) - $(".strategy_main").height() / 2) { if (ani_one_back == true) { $(".strategy_main ul").removeclass("addanimate"); ani_one = true; ani_one_back = false; } } } catch (e) { } } var issupporttouch = !!('ontouchend' in document); $(window).scroll(function () { if ($(window).width() > 768) { mwheelscroll(); } }) var top_toggle = 0; /*--------------------------------��ʒ��ӧ�� top--------------------------------------*/ var gettopsize = $(".product_top li").size(); if ($(".phone_menu").is(":hidden")) { var settopcount = 7; } else { var settopcount = 3; } if (gettopsize > 7) { $(".pt_btn_l").addclass("active").css({ "cursor": "default" }); } else { $(".pt_btn_l").addclass("active").css({ "cursor": "default" }); $(".pt_btn_r").addclass("active").css({ "cursor": "default" }); } try { var swiper = new swiper('.product_top', { paginationclickable: true, slidesperview: settopcount, grabcursor: true, spacebetween: 30, onslidechangeend: function (swiper) { if (gettopsize > 7) { getchange(swiper.activeindex); } }, ontouchend: function (swiper) { if (gettopsize > 7) { getchange(swiper.activeindex); } }, onfirstinit: function (swiper) { $(".product_top_wrap .product_top .swiper-slide:eq(0)").addclass("on"); $(".product_top .pt_btn_l").addclass("active").css({ "cursor": "default" }); } }); } catch (e) { } $(document).on("click", ".product_top li", function () { var nindex = $(".product_top li").index(this); $(this).addclass("on").siblings().removeclass("on"); swiper.swipeto(nindex) pro_ajax($(this).data("link")); }) try { pro_ajax($(".product_top li:eq(0)").data("link")); } catch (e) { } $(".pt_btn_l").click(function (e) { e.preventdefault() swiper.swipeprev() }) $(".pt_btn_r").click(function (e) { e.preventdefault() swiper.swipenext() }) function getchange(nindex) { if (nindex >= gettopsize - settopcount) { $(".pt_btn_r").addclass("active").css({ "cursor": "default" }); $(".pt_btn_l").removeclass("active").css({ "cursor": "pointer" }); } else if (nindex <= 0) { $(".pt_btn_l").addclass("active").css({ "cursor": "default" }); $(".pt_btn_r").removeclass("active").css({ "cursor": "pointer" }); } else { $(".pt_btn_l").removeclass("active").css({ "cursor": "pointer" }); $(".pt_btn_r").removeclass("active").css({ "cursor": "pointer" }); } } /*--------------------------------��ʒ��ӧ�� bottom--------------------------------------*/ var gettopsize1; var settopcount1; function getarticle() { gettopsize1 = $(".product_bottom_box li").size(); if ($(".phone_menu").is(":hidden")) { settopcount1 = 4; } else { settopcount1 = 2; } try { var swiper_bottom = new swiper('.product_bottom_box', { paginationclickable: true, slidesperview: settopcount1, grabcursor: true, spacebetween: 30, onslidechangeend: function (swiper) { getchange1(swiper.activeindex); }, ontouchend: function (swiper) { getchange1(swiper.activeindex); }, onfirstinit: function (swiper) { $(".product_bottom .swiper-slide:eq(0)").addclass("on"); $(".product_bottom .pt_btn_l").addclass("active").css({ "cursor": "default" }); $(".product_bottom_box").height($(".swipercolorwrap").innerheight() * 2); } }); } catch (e) { } $(".product_bottom_box .swiper-button-prev").addclass("active").css({ "cursor": "default" }); $(".product_bottom_box .swiper-button-prev").click(function (e) { e.preventdefault() swiper_bottom.swipeprev() }) $(".product_bottom_box .swiper-button-next").click(function (e) { e.preventdefault() swiper_bottom.swipenext() }) } function getchange1(nindex) { if (nindex >= gettopsize1 - settopcount1) { $(".product_bottom_box .swiper-button-next").addclass("active").css({ "cursor": "default" }); $(".product_bottom_box .swiper-button-prev").removeclass("active").css({ "cursor": "pointer" }); } else if (nindex <= 0) { $(".product_bottom_box .swiper-button-prev").addclass("active").css({ "cursor": "default" }); $(".product_bottom_box .swiper-button-next").removeclass("active").css({ "cursor": "pointer" }); } else { $(".product_bottom_box .swiper-button-prev").removeclass("active").css({ "cursor": "pointer" }); $(".product_bottom_box .swiper-button-next").removeclass("active").css({ "cursor": "pointer" }); } } $(document).on("mouseover", ".product_center_header li", function () { var nindex = $(".product_center_header li").index(this); $(this).removeclass("on").addclass("on").siblings().removeclass("on"); $(".product_center_main ul:eq(" + nindex + ")").show().siblings().hide(); }) //pro_ajax function pro_ajax(url) { $.ajax({ url: url, type: "get", success: function (msg) { $("#pro_ajax").html(msg); getarticle(); } }); } /*---------------------------------��ʒ����ҳ-----------------------------------------*/ var gettopsize2 = $(".product_detail_header_box li").size(); try { var product_detail_header_box = new swiper('.product_detail_header_box', { paginationclickable: true, grabcursor: true, onslidechangeend: function (swiper) { getchange2(swiper.activeindex); }, ontouchend: function (swiper) { getchange2(swiper.activeindex); }, onfirstinit: function (swiper) { $(".product_detail_header_box").height($(".product_main_inner").width() * 0.7497); $(".product_detail_header_box .swiper-button-prev").addclass("active").css({ "cursor": "default" }); } }); } catch (e) { } $(window).resize(function () { $(".product_detail_header_box").height($(".product_main_inner").width() * 0.7497); }) $(window).resize(); $(".product_detail_header_box .swiper-button-prev").click(function (e) { e.preventdefault() product_detail_header_box.swipeprev() }) $(".product_detail_header_box .swiper-button-next").click(function (e) { e.preventdefault() product_detail_header_box.swipenext() }) function getchange2(nindex) { if (nindex >= gettopsize2 - 1) { $(".product_detail_header_box .swiper-button-next").addclass("active").css({ "cursor": "default" }); $(".product_detail_header_box .swiper-button-prev").removeclass("active").css({ "cursor": "pointer" }); } else if (nindex <= 0) { $(".product_detail_header_box .swiper-button-prev").addclass("active").css({ "cursor": "default" }); $(".product_detail_header_box .swiper-button-next").removeclass("active").css({ "cursor": "pointer" }); } else { $(".product_detail_header_box .swiper-button-prev").removeclass("active").css({ "cursor": "pointer" }); $(".product_detail_header_box .swiper-button-next").removeclass("active").css({ "cursor": "pointer" }); } } /*********************����**********************/ $(document).on("click", ".technology_bottom_box .technology_bottom_r li", function () { var nindex = $(".technology_bottom_box .technology_bottom_r li").index(this); $(".technology_bottom_box .technology_bottom_l li:eq(" + nindex + ")").addclass("on"); $(".technology_bottom_box .technology_bottom_l li:eq(" + nindex + ")").siblings().removeclass("on"); $(".technology_bottom_box .technology_bottom_r li").removeclass("active").css({ "cursor": "pointer" }); $(".technology_bottom_box .technology_bottom_r li:eq(" + nindex + ")").addclass("active").css({ "cursor": "default" }); }) $(document).on("click", ".technology_bottom_box1 .technology_bottom_r li", function () { var nindex = $(".technology_bottom_box1 .technology_bottom_r li").index(this); $(".technology_bottom_box1 .technology_bottom_l li:eq(" + nindex + ")").addclass("on"); $(".technology_bottom_box1 .technology_bottom_l li:eq(" + nindex + ")").siblings().removeclass("on"); $(".technology_bottom_box1 .technology_bottom_r li").removeclass("active").css({ "cursor": "pointer" }); $(".technology_bottom_box1 .technology_bottom_r li:eq(" + nindex + ")").addclass("active").css({ "cursor": "default" }); }) $(".main_part3_tab span").click(function () { $(this).addclass("on").siblings().removeclass("on"); var geturl = $(this).data("href"); tec_ajax(geturl); }) try{ tec_ajax($(".main_part3_tab span:eq(0)").data("href")); } catch (e) { } $(window).resize(function () { gettec(".technology_bottom_box"); gettec(".technology_bottom_box1"); }) $(window).resize(); //tec_ajax function tec_ajax(url) { $.ajax({ url: url, type: "get", success: function (msg) { $("#technology_bottom").html(msg); gettec(".technology_bottom_box"); } }); } if ($(".phone_menu").is(":hidden")) { try { $(".axis_dir_box").mcustomscrollbar("destroy"); $(".axis_dir_box").mcustomscrollbar({}); } catch (e) { } } else { try{ $(".axis_dir_box").mcustomscrollbar("destroy"); } catch (e) { } } function gettec(target) { if ($(".phone_menu").is(":hidden")) { $(target).height($(target).width() * 0.3812); try{ $(target + " .technology_bottom_r_box").mcustomscrollbar("destroy"); $(target + " .technology_bottom_r_box").mcustomscrollbar({}); } catch (e) { } } else { var gettopsize2_tec = $(target + " .technology_bottom_l li").size(); try { var product_detail_header_box_tec = new swiper(target + ' .technology_bottom_l', { paginationclickable: true, grabcursor: true, onslidechangeend: function (swiper) { getchange2_tec(swiper.activeindex); }, ontouchend: function (swiper) { getchange2_tec(swiper.activeindex); }, onfirstinit: function (swiper) { $(target + " .technology_bottom_l").height($(target + " .technology_bottom_l").width() * 0.56); $(target + " .technology_bottom_l .swiper-button-prev").addclass("active").css({ "cursor": "default" }); } }); } catch (e) { } $(target + " .technology_bottom_l .swiper-button-prev").click(function (e) { e.preventdefault() product_detail_header_box_tec.swipeprev() }) $(target + " .technology_bottom_l .swiper-button-next").click(function (e) { e.preventdefault() product_detail_header_box_tec.swipenext() }) function getchange2_tec(nindex) { if (nindex >= gettopsize2_tec - 1) { $(target + " .technology_bottom_l .swiper-button-next").addclass("active").css({ "cursor": "default" }); $(target + " .technology_bottom_l .swiper-button-prev").removeclass("active").css({ "cursor": "pointer" }); } else if (nindex <= 0) { $(target + " .technology_bottom_l .swiper-button-prev").addclass("active").css({ "cursor": "default" }); $(target + " .technology_bottom_l .swiper-button-next").removeclass("active").css({ "cursor": "pointer" }); } else { $(target + " .technology_bottom_l .swiper-button-prev").removeclass("active").css({ "cursor": "pointer" }); $(target + " .technology_bottom_l .swiper-button-next").removeclass("active").css({ "cursor": "pointer" }); } } } } $(window).resize(function () { $(".axis_wrap").height($(".axis_wrap").width() * 0.4631); var vratio_at = 0.6356; var vwidth_at = $(".axis_wrap_l_top").width(); var vheight_at = $(".axis_wrap_l_top").height(); var screeneq3_at = vheight_at / vwidth_at; if (screeneq3_at < vratio_at) { $(".axis_wrap_l_top > img").css({ "width": vwidth_at, "height": vwidth_at * vratio_at, "left": "0%", "top": "50%", "marginleft": 0, "margintop": (vwidth_at * vratio_at / 2) * -1 }); } else { $(".axis_wrap_l_top > img").css({ "width": vheight_at / vratio_at, "height": vheight_at, "left": "50%", "top": "0%", "marginleft": (vheight_at / vratio_at) / 2 * -1, "margintop": 0 }); } }) $(window).resize(); })