", { 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);
}