history.scrollRestoration = 'manual'; var WD = function() {}; var _w = new WD(); (function() { $(function() { WD.prototype.h = $('html'); WD.prototype.b = $('body'); if (isFrontEnv()) { _w.b.addClass('wd'); _w.loop_events(); if (location.href.indexOf("debug") != -1) { _w.b.addClass("debug"); return; } index(); _w.service(); $("img[alt='椋熷搧宸ヤ綔鏈?]").attr("alt", "椋熷搧宸ヤ綔鏈?).attr("title", "椋熷搧宸ヤ綔鏈?); setTimeout(function() { _w.b.addClass("loaded"); }, 1000 + 1000 * Math.random()); } else { _w.b.addClass("make"); } }); })(); WD.prototype.service = function() { var t = this; var s = $("
"); s.addClass("w-float-service"); s.append('鐐瑰嚮杩欓噷缁欐垜鍙戞秷鎭? title='); s.append('鐐瑰嚮杩欓噷缁欐垜鍙戞秷鎭? title='); s.append('鐐瑰嚮杩欓噷缁欐垜鍙戞秷鎭? title='); t.b.append(s); }; WD.prototype.loop_events = function() { setInterval(function() { // imgs (function() { if ($("#c_product_list-15540487013313511").length) { return; } var w = $("img[lazy-src]"); w.each(function() { $(this).attr("src", $(this).attr("src")).removeAttr("src"); }); })(); }, 500); setInterval(function() { if ($("#c_product_list-15540487013313511").length) { return; } }, 100); }; WD.prototype.append = function(r, parent) { var _r = r.split(","); var w = {}; for (var i = 0; i < _r.length; i++) { var b = _r[i].split(":"); w[$.trim(b[0])] = $.trim(b[1]); } var div = $("<" + (w.tag || "div") + ">"); if (w.class) { div.addClass(w.class); } if (w.text) { div.text(w.text); } if (w.html) { div.html(w.html); } if (w.id) { div.attr("id", w.id); } if (parent) { parent.append(div); } else { this.b.append(div); } return div; }; function index() { // index if ($("#c_nav_main-15480349681579639").length) { make_home_page(); } else { // sub scroll_ani2(); // nav $(".c_nav_main-02001").each(function() { var t = $(this); }); $(".wd-search").find("svg").click(function() { window.open("/sousu.html?searchCategory=product&searchKey=" + encodeURIComponent(encodeURI($(this).prev().val())), "_blank"); }).prev().keypress(function(e) { if (e.key == "Enter") { window.open("/sousu.html?searchCategory=product&searchKey=" + encodeURIComponent(encodeURI($(this).val())), "_blank"); } }); // tong lang auto height $(".c_breadcrumb_nav-01001").parents(".w_wbox-001").addClass("w-auto-height"); sub_cate_highlight(); $(window).load(function() { var i = 0; var timer = setInterval(function() { var height = 0; var a = $(".w-auto-height"); var b = a.children().children().children(); var max = 0; b.each(function() { var s = $(this).offset().top + $(this).height() - a.offset().top; if (s > max) { max = s; } }); a.height(max); i++; if (i > 500) { clearInterval(timer); } }, 50); $("img").attr("title", ""); }); setTimeout(function() { var header = $(".c_nav_main-02001").parents(".w_wbox-001"); var scroll_top_number = $(window).scrollTop(); function scroll_handle() { var t = $(window).scrollTop(); if (t > 0) { header.addClass("w-small-nav"); if (t > scroll_top_number) { header.addClass("w-hide"); } else { header.removeClass("w-hide"); } scroll_top_number = t; } else { header.removeClass("w-small-nav"); } } scroll_handle(); $(window).scroll(function() { scroll_handle(); }); }, 1000); } } function make_home_page() { // header (function() { var header = _w.append("id:w-header"); var wrapper = _w.append("class:wrapper", header); var logo = _w.append("class:logo", wrapper); var nav = _w.append("class:nav, id:w-nav", wrapper); //var right = _w.append("class:tel", wrapper); // logo logo.append("椋熷搧宸ヤ綔鏈?/></a>");

        // nav
        var nav_a = $(".w-nav a");
        _w.append("class:more", nav);
        for (var i = 0; i < 3; i++) {
            _w.append("tag:span", nav.find(".more"));
        }
        nav.append(nav_a);
        nav.append("<div class=
").find(".wd-search").append('').find("svg").click(function() { window.open("/sousu.html?searchCategory=product&searchKey=" + encodeURIComponent(encodeURI($(this).prev().val())), "_blank"); }).prev().keypress(function(e) { if (e.key == "Enter") { window.open("/sousu.html?searchCategory=product&searchKey=" + encodeURIComponent(encodeURI($(this).val())), "_blank"); } }); header.hover(function() { $(this).addClass("show-full-nav"); }, function() { $(this).removeClass("show-full-nav"); }); header.addClass("w-small-nav"); var scroll_top_number = $(window).scrollTop(); function scroll_handle() { var t = $(window).scrollTop(); if (t > 0) { // header.addClass("w-small-nav"); if (t > scroll_top_number) { header.addClass("w-hide"); } else { header.removeClass("w-hide"); } scroll_top_number = t; } else { // header.removeClass("w-small-nav"); } } $(window).scroll(function() { scroll_handle(); }); })(); // banner (function() { var banner = _w.append("id:w-banner"); /* banner.append($("#c_ebizads_banner-15480349065286882 img")); var imgs = banner.find("img"); imgs.first().addClass("current"); */ banner.append($("#c_ebizads_banner-15480349065286882").css("position", "static")); var tip = _w.append("class:tip", banner); _w.append("tag:span,text:explorer", tip); })(); // products (function() { var keys = [37, 38, 39, 40]; function preventDefault(e) { e = e || window.event; if (e.preventDefault) e.preventDefault(); e.returnValue = false; } function keydown(e) { for (var i = keys.length; i--;) { if (e.keyCode === keys[i]) { preventDefault(e); return; } } } function wheel(e) { preventDefault(e); } function disable_scroll() { if (window.addEventListener) { window.addEventListener('DOMMouseScroll', wheel, false); } window.onmousewheel = document.onmousewheel = wheel; document.onkeydown = keydown; } function enable_scroll() { if (window.removeEventListener) { window.removeEventListener('DOMMouseScroll', wheel, false); } window.onmousewheel = document.onmousewheel = document.onkeydown = null; } var products = _w.append("id:w-products"); var wrapper = _w.append("class:wrapper", products); $(".c_product_categorylay-01001").each(function() { var t = $(this); var list = t.find(".p_articles"); var a = products.addClass("w-index-products-category"); var b = a.find(".wrapper"); list.each(function() { var item = $("
", { class: "item" }); var a = $(this).find(".e_link").eq(0); var href = a.attr("href"); var image = a.find("img"); var src = image.attr("lazy-src") ? image.attr("lazy-src") : image.attr("src"); var title = $.trim($(this).find(".p_title").text()); var english = $.trim($(this).find(".p_summary").text()); var summary = $.trim($(this).find(".p_DescribeBox .reset_style").text()); src && src.indexOf("_{") != -1 && (src = src.split("_{")[0]); var d_image = $("
", { class: "w-image" }); var d_english = $("
", { class: "w-english" }); var d_title = $("
", { class: "w-title" }); var d_title_p = $("

", { class: "title", text: title }); d_title.append(d_title_p); var d_summary = $("

", { class: "summary" }); d_summary.text(summary); d_title.append(d_summary); var d_more = $("
", { class: "w-more" }); d_title.append(d_more); var d_more_a = $(""); d_more.append(d_more_a); d_more_a.attr("href", href).text("鏌ョ湅鏇村"); item.append(d_image); item.append(d_english); item.append(d_title); d_image.append("" + title + ""); d_english.append("" + english + "

PRODUCTS CATEGORY

"); b.append(item); }); var items = a.find(".item"); items.eq(0).addClass("current"); var d_cate_left = $("
", { class: "w-cate-left" }); b.append(d_cate_left); items.each(function() { d_cate_left.append("" + $(this).find(".title").text() + ""); }); var d_cate_left_span = d_cate_left.children(); d_cate_left_span.eq(0).addClass("current"); /* d_cate_left_span.click(function() { if(!$(this).hasClass("current")) { index = d_cate_left_span.index($(this)); do_ani(); } }); */ var d_btn = $("
", { class: "w-btns" }); var d_scroller = $("
", { class: "w-scroller" }); items.each(function() { d_btn.append(""); d_scroller.append(""); }); var d_btns = d_btn.find("span"); var d_scrollers = d_scroller.find("span"); var index = 0; d_btns.eq(index).addClass("current"); d_scrollers.eq(index).addClass("current"); d_scrollers.width(1500 * 0.3 / d_scrollers.length); b.append(d_btn); b.append(d_scroller); d_scrollers.click(function() { if (!$(this).hasClass("current")) { var i = d_scrollers.index($(this)); index = i; do_ani(); } }); function do_ani() { items.removeClass("current"); items.eq(index).addClass("current"); d_btns.removeClass("current").eq(index).addClass("current"); d_scrollers.removeClass("current").eq(index).addClass("current"); d_cate_left_span.removeClass("current").eq(index).addClass("current"); } var timer; var down = false; var scroll_down_index = 0; function start() { timer = setInterval(function() { index++; if (index > items.length - 1) { index = 0; } do_ani(); }, 5000); } start(); d_scrollers.hover(function() { clearInterval(timer); }, function() { start(); }); d_cate_left.hover(function() { clearInterval(timer); }, function() { start(); }); d_cate_left_span.hover(function() { var i = d_cate_left_span.index($(this)); if (i != index) { index = i; do_ani(); } }).click(function() { location.href = $(this).attr("data-href"); }); /* items.mousewheel(function(e) { // 鍚戜笅 if(!down && e.deltaY == -1) { index++; scroll_down_index++; if(scroll_down_index > items.length - 1) { scroll_down_index = items.length - 1; return; } if(index > items.length - 1) { index = 0; } do_ani(); } // 鍚戜笂 if(!down && e.deltaY == 1) { index--; scroll_down_index--; if(scroll_down_index < 0) { scroll_down_index = 0; return; } if(index < 0) { index = items.length - 1; } do_ani(); } }); */ }); })(); // advantage (function() { var w = $(".w-index-advantage"); _w.append("id:w-advantage").append(w); var item = w.find(".item"); var current_item_index = 0; item.eq(0).addClass("current"); $(".words-each-ani").each(function() { var t = $(this).text(); t = $.trim(t); $(this).text(""); var _t = $(this); $.each(t.split(""), function(i, v) { _t.append("" + v + ""); }); }); function random(max) { max = max || 0; if (max == 0) { return false; } var current = -1; function next() { var a = Math.floor(Math.random() * max); while (a == current) { a = Math.floor(Math.random() * max); } current = a; return a; } function direction() { if (Math.random() > 0.5) { return true; } else { return false; } } return { next: next, direction: direction } } function item_1() { var w = item.eq(0); var line = w.find(".lines .line .a"); var circle = w.find(".circle .c"); var circle_name = ["鍔犳嬁澶?]; circle_name.push("娆ф床"); circle_name.push("缇庡浗"); circle_name.push("淇勭綏鏂?); circle_name.push("澧ㄨタ鍝?); circle_name.push("娌欑壒闃挎媺浼?); circle_name.push("宸村熀鏂潶"); circle_name.push("鍗楅潪"); circle_name.push("鏂板姞鍧?); circle_name.push("瀛熷姞鎷夊浗"); circle_name.push("闊╁浗"); circle_name.push("涓浗"); circle_name.push("鍗板害"); circle_name.push("娉板浗"); circle_name.push("鏂板姞鍧?); circle_name.push("鏃ユ湰"); $.each(circle_name, function(i, v) { circle.eq(i).append("" + v + ""); }); line.each(function() { $(this).data("width", $(this).width()); }); var _random = random(line.length); function ani() { var index = _random.next(); var _line = line.eq(index); var width = _line.width(); if (width == 0) { _line.animate({ width: _line.data("width") }, 1000); } else { _line.animate({ width: 0 }, 1000); } } setInterval(function() { if (current_item_index == 0) { ani(); } }, 500 + Math.random() * 1000); setInterval(function() { if (current_item_index == 0) { ani(); } }, 100 + Math.random() * 1000); } item_1(); function item_2() { var w = item.eq(1); var brands = w.find(".content .l:not(.n)"); var brands_n = w.find(".content .l.n"); var _random = random(brands.length); var _random2 = random(brands_n.length); function ani() { var index = _random.next(); var _brand = brands.eq(index); var opacity = _brand.css("opacity"); if (opacity == 0) { _brand.animate({ opacity: 1 }, 1000); } else { _brand.animate({ opacity: 0 }, 1000); } } function ani2() { var index = _random2.next(); var _brand = brands_n.eq(index); var opacity = _brand.css("opacity"); if (opacity == 0.5) { _brand.animate({ opacity: 1 }, 1000); } else { _brand.animate({ opacity: 0.5 }, 1000); } } setInterval(function() { if (current_item_index == 1) { ani2(); } }, 800 + Math.random() * 1000); setInterval(function() { if (current_item_index == 1) { ani(); } }, 100 + Math.random() * 400); setInterval(function() { if (current_item_index == 1) { ani(); } }, 500 + Math.random() * 400); } item_2(); function item_3() { } item_3(); function item_4() { var w = item.eq(3); var d = w.find(".content").children(); d.each(function() { var a = $(this).find(".c"); for (var i = 0; i < 100; i++) { a.append("
"); } }); var _random = random(d.length); setInterval(function() { d.removeClass("current").eq(_random.next()).addClass("current"); }, 6500); var s = w.find(".words .a div"); var _random_s = random(s.length); } //item_4(); function item_5() { var w = item.filter(".item-5"); var bg = w.find(".bgs div"); var bg_video = bg.find("video"); var first_bg = bg.eq(0); var cate_li = w.find(".cate li"); var summary_li = w.find(".summary li"); cate_li.eq(0).addClass("current"); summary_li.eq(0).addClass("current"); cate_li.click(function() { var t = $(this); if (!t.hasClass("current")) { cate_li.removeClass("current"); t.addClass("current"); var index = cate_li.index(t); first_bg.removeClass().addClass("left-" + index); bg_video.each(function() { var t = $(this); var a = t.get(0); a.pause(); a.currentTime = 0; }); bg_video.eq(index).get(0).play(); summary_li.removeClass("current").eq(index).addClass("current"); } }); } item_5(); // showitem4 var right_btns = $(".wd .w-index-advantage .right-btns div"); right_btns.eq(0).addClass("current"); right_btns.click(function() { if (!$(this).hasClass("current")) { current_item_index = right_btns.index($(this)); right_btns.removeClass("current").eq(current_item_index).addClass("current"); item.removeClass("current").eq(current_item_index).addClass("current"); } }); var index = 0; $(".w-index-advantage .w-btn-prev").click(function() { index--; if (index < 0) { index = 3; } current_item_index = index; item.removeClass("current").eq(current_item_index).addClass("current"); }); $(".w-index-advantage .w-btn-next").click(function() { index++; if (index > 3) { index = 0; } current_item_index = index; item.removeClass("current").eq(current_item_index).addClass("current"); }); var each_item_fun = [item_1, item_2, item_3, item_5]; // 10s change setInterval(function() { current_item_index++; if (current_item_index > item.length - 1) { current_item_index = 0; } item.removeClass("current").eq(current_item_index).addClass("current"); right_btns.removeClass("current").eq(current_item_index).addClass("current"); }, 20000); })(); // news (function() { var w = _w.append("id:w-news"); function w_news_20181212201503(id) { var a = $("#" + id); var p_news_list = a.find(".p_Newslist"); var container = $("
", { class: "w-container" }); var left = $("
", { class: "w-left" }); var right = $("
", { class: "w-right" }); var btn = $("
", { class: "w-btns" }); var time = $("
", { class: "w-time" }); w.append(container); var title = _w.append("class:w-title", container); title.append("
news
"); title.append("
鏂伴椈璧勮
"); container.append(left); container.append(right); container.append(btn); container.append(time); var btn_prev = $("
", { class: "prev" }); var btn_next = $("
", { class: "next" }); btn.append(btn_prev); btn.append(btn_next); var list = p_news_list.find(".p_articles"); list.each(function() { var t = $(this); var item = $("
", { class: "w-item" }); item.append(t.find(".p_title")); item.append(t.find(".p_time")); item.append(t.find(".p_summary")); var image = $("
", { class: "w-image" }); image.append(t.find(".e_link")); left.append(item); right.append(image); }); left.find(".p_title").hover(function() { $(this).closest(".w-item").addClass("title-in"); }, function() { $(this).closest(".w-item").removeClass("title-in"); }); /* left.addClass("swiper-container"); left.children().addClass("swiper-slide").wrapAll("
"); */ var items = left.children(); //left.append(items.clone()); items.eq(0).addClass("current"); var images = right.children(); right.addClass("current-1"); var item_index = 0; var current_index = item_index; var animating = false; function handle() { /* items.eq(0).animate({"margin-top":-item_index*225}, 1000, function() { animating = false; if(item_index == items.length) { item_index = 0; } }); */ // items.removeClass("current").eq(item_index).addClass("current"); /* images.each(function(i) { if(i < item_index) { $(this).addClass("w-hide"); } else { $(this).removeClass("w-hide"); } }); images.removeClass("current").eq(item_index).addClass("current"); */ right.removeClass("current-1 current-2 current-3 current-4 current-5 current-6").addClass("current-" + (item_index + 1)); } items.mouseenter(function() { items.removeClass("current"); $(this).addClass("current"); item_index = items.index($(this)); handle(); }); btn_prev.click(function() { if (!animating) { item_index--; if (item_index < 0) { item_index = 0; } else { animating = true; handle(); } } }); btn_next.click(function() { if (!animating) { item_index++; if (item_index > items.length) { item_index = items.length; } else { animating = true; handle(); } } }); } w_news_20181212201503("c_xnews_list-15480359685503124"); })(); // index about us (function() { var w = _w.append("id:w-index-aboutus"); var title = _w.append("class:w-title", w); title.append("

" + $("#w_common_text-1554173346399").text() + "

"); title.append("" + $("#w_common_text-1554173308296").text() + ""); var sub_title = _w.append("class:w-sub-title", w); sub_title.append($("#w_common_text-1554173373155 p")); var list = _w.append("class:w-list", w); list.append($(".w-index-aboutus")); })(); // partner (function() { var w = _w.append("id:w-partner"); var title = _w.append("class:w-title", w); var sub_title = _w.append("class:w-sub-title", w); var list = _w.append("class:w-list", w); title.append($("#w_common_text-1548036153452 p > span")); sub_title.append($("#w_common_text-1548036153467 p")); list.append($("#w_img-1548036153482 img")); var more = _w.append("class:w-more", w); var a = _w.append("tag:a", more).addClass("w--more"); a.attr("href", "/nav/18.html"); var span = _w.append("tag:span, text:鏌ョ湅鏇村鍚堜綔浼欎即", a); })(); // contact us (function() { var w = _w.append("id:w-contact"); var wrapper = _w.append("class:wrapper", w); var title = _w.append("class:w-title", wrapper); title.append($("#w_common_text-1548124678769 span").last()); title.append($("#w_common_text-1548123523605 span").last()); var info = _w.append("class:w-content", wrapper); var item = _w.append("class:item", info); item.append($("#w_common_text-1548123549553 p").last()); item.append($("#w_common_text-1548123560871 p")); item = _w.append("class:item", info); item.append($("#w_common_text-1548124939077 p").last()); item.append($("#w_common_text-1548124939091 p")); wrapper.append($("#w_img-1548124991068 img").addClass("w1")); wrapper.append($("#w_img-1548125015665 img").addClass("w2")); w.append($("#w_img-1548124960416 img").addClass("b1")); w.append($("#w_img-1548124973564 img").addClass("b2")); })(); // back to top // footer (function() { var w = _w.append("id:w-back-to-top"); var wrapper = _w.append("class:wrapper", w); wrapper.append("绗竴椤袋/span>"); w.click(function() { $("html,body").animate({ scrollTop: 0 }, 1000); }); })(); // footer (function() { var w = _w.append("id:w-footer"); var top = _w.append("class:top", w); var wrapper = _w.append("class:wrapper", top); var left = _w.append("class:w-left", wrapper); left.append("涓夊绉戞妧"); left.append("鐢宠璧勬枡"); left.append("鍜ㄨ"); wrapper.append($(".w-footer-nav")); wrapper.append($(".w-footer-erweima")); var bottom = _w.append("class:bottom", w); wrapper = _w.append("class:wrapper", bottom); wrapper.append($(".w-footer-copyright")); wrapper.append($(".w-footer-share")); })(); scroll_ani($("body").children().not(".pagebox"), "w-scroll-in"); var advantage_tip = _w.append("id:w-advantage-tip"); } function scroll_ani(_divs, _css_name) { var css_name = _css_name || "show"; inView = function(w, fn) { var t = w.offset().top; if (t < $(window).scrollTop() + $(window).height() / 3 * 2) { fn(w); } }; function scrollHandler() { var index = 0; var divs = _divs || $('.pagebox > div[id]:not(.w)'); divs.each(function() { inView($(this), function(w) { w.addClass('w'); /* setTimeout(function() { w.children().filter('div').addClass(css_name); }, index * 200); */ w.addClass(css_name); index++; }); }); } scrollHandler(); $(window).scroll(function() { scrollHandler(); }); } function scroll_ani2() { var css_name = "show"; inView = function(w, fn) { var t = w.offset().top; if (t < $(window).scrollTop() + $(window).height()) { fn(w); } }; function scrollHandler() { var index = 0; var divs = $('.pagebox > div[id]:not(.w)'); divs.each(function() { inView($(this), function(w) { w.addClass('w'); setTimeout(function() { w.children().filter('div').addClass(css_name); }, index * 200); index++; }); }); } scrollHandler(); $(window).scroll(function() { scrollHandler(); }); } function sub_cate_highlight() { $(".p_breadcrumbCurrent, .p_breadcrumb").each(function() { var t = $.trim($(this).find("span").text()); if (t != "") { var cate = $("div[class^='c_intro_category-']"); if (cate.length) { lazy("div[class^='c_intro_category-'] .p_articles", function(b) { b.find(".p_articlesA:contains('" + t + "')").addClass("active"); }); return; } cate = $("div[class^='c_product_category-']"); if (cate.length) { lazy("div[class^='c_product_category-'] .p_articles .p_articles", function(b) { b.find(".font:contains('" + t + "')").closest(".p_articles").addClass("active"); }); } cate = $("div[class^='c_news_category-']"); if (cate.length) { lazy("div[class^='c_news_category-'] .p_articles .p_articles", function(b) { b.find(".font:contains('" + t + "')").closest(".p_articles").addClass("active"); }); } } }); } function lazy(a, c) { var timer = setInterval(function() { var b = $(a); if (b.length) { clearInterval(timer); c(b); } }, 100); }