var wd = {}; wd.animate = TweenMax; wd.scroll_ani = function() { var window_height = $(window).height(); var body = $("body"); function handle() { var t = $(window).scrollTop(); var w = $(".w-scroll-ani:not(.scrolled)"); w.each(function(i) { var top = $(this).offset().top; if(top < (window_height + t - 100)) { setTimeout(function() { $(this).addClass("scrolled"); }.bind(this), i*100); } }); if(window_height + t + 200 >= body.height()) { $(".w-scroll-ani:not(.scrolled)").each(function(i) { var top = $(this).offset().top; if(top > (body.height() - window_height)) { setTimeout(function() { $(this).addClass("scrolled"); }.bind(this), i*100); } }); } } return { add:function(a) { $(a).addClass("w-scroll-ani"); return this.add; }, init:function() { this.add("div[id^='w_common_text-']"); this.add(".w_fimg-000:not('#w_fimg-1588148032942')"); this.add(".w_fbtn-001"); this.add(".w_ficon-001"); this.add(".w_fline-001"); this.add("div[class*='c_portalResProduct_detail']"); this.add(".c_portalResMessage_form-01001"); //this.add(".c_portalResEbizads_banner-01001"); //this.add(".c_portalResEbizads_banner-01001 .bannerTitle"); //this.add(".c_portalResEbizads_banner-01001 .summry"); this.add(".c_portalResProduct_list-01001001 .PhotoList_k1 li"); this.add(".c_portalResnav_main-01001 .top-nav"); this.add(".c_portalResIntro_detail-01001"); this.add(".w_fimgbox-001"); this.add(".c_portalResNews_list-01001 .newList"); this.add(".c_portalResNews_detail-01001 .p_header"); this.add(".c_portalResNews_detail-01001 .p_dataSource"); this.add(".c_portalResNews_detail-01001 .p_summary"); this.add(".c_portalResNews_detail-01001 .p_articles"); this.add(".c_portalResNews_detail-01001 .p_PrevAndNext"); this.add(".c_portalResProduct_list-01001"); this.add(".c_portalResNews_list-01001 .p_articles"); this.add(".c_portalResEmploy_list-01001 .jobList"); this.add(".c_portalResProduct_list-01001 .p_Product"); this.add(".c_portalResSearch_total-01001"); this.add(".c_portalResPublic_websiteShare-01001 .iShare a"); this.add(".c_portalResPublic_codeContainer-01001"); this.add(".wd-20201127092601 li"); this.add(".c_portalResPublic_codeContainer-01001003"); this.add(".c_portalResProduct_category-01001"); $(window).scroll(function() { handle(); }); handle(); } }; }; wd.rightFloat = function() { var config = { email: "yxgs@cckdq.com", tel: "400-64-30001", message: "/contact.html" }; var right = $("
").addClass("wd-right-float"); var email = $("
").addClass("wd-item email").append(''+SVG_EMAIL+'').append("
" + config.email + "
"); var phone = $("
").addClass("wd-item phone").append(''+SVG_PHONE+'').append("
" + config.tel + "
"); ;var message = $("
").addClass("wd-item message").append(''+SVG_MESSAGE+'').append("
鐐瑰嚮鐣欒█
"); var top = $("
").addClass("wd-item top").append(''+SVG_BACK_TO_TOP+''); right.append(email).append(phone).append(message).append(top); $("body").append(right); right.find(".wd-item").last().click(function() { $("html,body").animate({ scrollTop: 0 }, 1000); }); $(window).scroll(function() { if($(window).height() + $(window).scrollTop() + $(window).height() / 2 >= wd.body.height()) { right.addClass("wd-hide"); } else { right.removeClass("wd-hide"); } }); setTimeout(function() { right.addClass("wd-show"); }, 500); };