jQuery(document).ready(function () { // 濡傛灉閾炬帴涓湁 ?esg=pdf 寮圭獥瑕佹墦寮€ if (window.location.search == '?esg=pdf') { jQuery(".esg_popup_box").show() jQuery(".esg_info_message").show() jQuery(".esg_popup").hide() if (jQuery(".mob_menu")) { jQuery(".mob_menu").removeClass("show"); } } else { jQuery(".esg_popup_box").hide() jQuery(".esg_info_message").hide() jQuery(".esg_popup").hide() } // 鍏抽棴涓嬭浇寮圭獥 jQuery(".esg_popup_close").click(function () { jQuery(".esg_popup_box").hide() jQuery(".esg_info_message").hide() jQuery(".esg_popup").hide() }) // 鐐瑰嚮浜嗘彁浜 淇℃伅 info_message_submit jQuery(".info_message_submit").click(function () { var num = 0 jQuery(".info_message_input input").each(function() { if (jQuery(this).val() !== '') { num++ if (num == 4) { var params = { name: $(".info_name").val(), company: $(".info_company").val(), post: $(".info_duties").val(), phone: $(".info_tel").val(), } jQuery.ajax({ type: "POST", url: "https://oc.leqee.com/elastic/unfortified/saveViewerInfo", data: JSON.stringify(params), dataType : "json", success: function(respMsg){ jQuery(".esg_info_message").hide() jQuery(".esg_popup").show() } }) } } }) }) // 鐐瑰嚮浜唒c ESG鎶ュ憡 jQuery(".esg_report").click(function () { jQuery(".esg_popup_box").show() jQuery(".esg_info_message").show() jQuery(".esg_popup").hide() }) // 鐐瑰嚮浜唌ob ESG鎶ュ憡 jQuery(".esg_report_mob").click(function () { if (jQuery(".mob_menu")) { jQuery(".mob_menu").removeClass("show"); } jQuery(".esg_popup_box").show() jQuery(".esg_info_message").show() jQuery(".esg_popup").hide() }) // jQuery(".block_stick").each(function (index, element) { jQuery(element).css("z-index", index + 100); }); jQuery(".button_mob_menu").click(function () { jQuery(".mob_menu").addClass("show"); }); //button_mob_menu_close jQuery(".button_mob_menu_close").click(function () { jQuery(".mob_menu").removeClass("show"); }); jQuery("#job_submit").click(function (e) { jQuery(".job_list_item").removeClass("show"); jQuery(".job_list_error").removeClass("show"); if (jQuery("#city").val() == "") { jQuery(".job_list_item").addClass("show"); } else if (jQuery("#city").val() == "鏉窞") { jQuery(".job_list_item").eq(0).addClass("show"); jQuery(".job_list_item").eq(1).addClass("show"); } else { jQuery(".job_list_error").addClass("show"); } e.preventDefault(); }); jQuery(".number_grid").each(function (index, Element) { jQuery(Element) .children(".animation_slide_up") .each(function (indexInArray, valueOfElement) { jQuery(valueOfElement).css( "transition-delay", indexInArray * 0.3 + "s" ); }); }); var body = (document.compatMode && document.compatMode == 'CSS1Compat') ? document.documentElement : document.body; $(".move_down").on("click", function () { $("HTML, BODY").animate( { scrollTop: body.clientHeight, }, 800 ); }); }); // jQuery(window).on("scroll", function (e) { // if (jQuery(window).scrollTop() > 100) { // //jQuery(".site-header").addClass("shrink"); // } else { // //jQuery(".site-header").removeClass("shrink"); // } // // jQuery(".parallax").each(function (index, element) { // var sTop = jQuery(window).scrollTop(); // // //console.log(sTop - jQuery(element).offset().top); // // jQuery(element).css( // "transform", // "translate3d(0, " + (sTop - jQuery(element).offset().top) * 0.1 + "px, 0)" // ); // }); // // jQuery(".parallax2").each(function (index, element) { // var sTop = jQuery(window).scrollTop(); // // //console.log(sTop - jQuery(element).offset().top); // // jQuery(element).css( // "transform", // "translate3d(0, " + // -((sTop - jQuery(element).offset().top) * 0.1) + // "px, 0)" // ); // }); // }); jQuery(window).on("scroll", function (e) { /// do_animation(); check_stick(); }); function do_animation() { var sTop = jQuery(window).scrollTop(); jQuery(".animation_slide_up, .service_item").each(function (index, element) { var top_of_object = jQuery(element).offset().top; var bottom_of_object = jQuery(element).offset().top + jQuery(element).height(); var bottom_of_window = sTop + screen.height * 0.8; if ( bottom_of_window > top_of_object && sTop < top_of_object + bottom_of_object ) { jQuery(element).addClass("show"); } else { jQuery(element).removeClass("show"); } }); //animation_slide_left jQuery(".animation_fade_in").each(function (index, element) { var top_of_object = jQuery(element).offset().top; var bottom_of_window = sTop + screen.height * 0.8; //console.log(sTop, top_of_object, bottom_of_window); if (bottom_of_window > top_of_object) { jQuery(element).addClass("show"); } }); jQuery(".animation_open").each(function (index, element) { var top_of_object = jQuery(element).offset().top; var bottom_of_window = sTop + screen.height * 0.9; //console.log(sTop, top_of_object, bottom_of_window); if (bottom_of_window > top_of_object) { jQuery(element).addClass("show"); } }); } function check_stick() { jQuery(".block_stick").each(function (index, element) { var sTop = jQuery(window).scrollTop(); var top_of_object = jQuery(element).offset().top; var height_of_object = jQuery(element).height(); var opacity = (sTop - top_of_object) / 100 + 2; //鍋忕Щ30% if ( sTop >= top_of_object - height_of_object * 0.3 && sTop < top_of_object + height_of_object - height_of_object * 0.3 ) { // console.log(opacity); jQuery(element).find(".scroll_show").css("opacity", opacity); } else { jQuery(element).find(".scroll_show").css("opacity", 0); } if (sTop >= top_of_object && sTop < top_of_object + height_of_object) { jQuery(element).children("div").addClass("stick"); } else { if ( index == jQuery(".block_stick").lenght - 1 && sTop > top_of_object + height_of_object ) { //do nothing } else { jQuery(element).children("div").removeClass("stick"); } } // }); }