/*swiper banner*/
if($('.swiper-wrapper .swiper-slide').length<2){$('.swiper-pagination').hide()}
var myswiper = new swiper('.slider_banner_c',{
effect: 'fade',
speed: 1000,
loop:true,
autoplay: {
delay: 3500,
disableoninteraction: false,
},
navigation: {
nextel: '.slider_banner_c .slider_banner_next',
prevel: '.slider_banner_c .slider_banner_prev',
},
on:{
init: function(){
var _that=this;
setcurpage('.slider_banner',_that)
}
}
});
myswiper.on('slidechange', function () {
setcurpage('.slider_banner',myswiper)
});
function setcurpage(sliderwrap,ele){
var curindex=ele.realindex+1;
var total=ele.slides.length-2;
var curhtml='0'+curindex+''+'/'+'0'+total+'';
$(sliderwrap).find('.slide-page-box').html(curhtml);
}
$('.product_items_wrap').each(function(){
if($(this).find('.product_items').length>0){
var swiper = new swiper($(this).find('.product_items'), {
loop:true,
slidesperview:4,
// init: false,
navigation: {
nextel: $(this).find('.btn_next'),
prevel: $(this).find('.btn_prev'),
},
pagination: {
el:$(this).find('.slide_pagination') ,
clickable: true,
},
breakpoints: {
1024: {
},
768: {
slidesperview: 3,
},
640: {
slidesperview: 2,
},
480: {
slidesperview: 1,
}
}
});
}
})
$('.page_container03').each(function(){
if($(this).find('li').length>0){
var swiper = new swiper($(this).find('.tab_img_wrap'), {
slidesperview:4,
spacebetween:10,
// init: false,
autoplay: {
delay: 3500,
disableoninteraction: false,
},
loop:true,
navigation: {
nextel: $(this).find('.btn_next'),
prevel: $(this).find('.btn_prev'),
},
pagination: {
el:$(this).find('.slide_pagination') ,
clickable: true,
},
breakpoints: {
1024: {
},
768: {
slidesperview: 3,
},
640: {
slidesperview: 2,
},
480: {
slidesperview: 1,
}
}
});
}
})
$('.entry').find('img').parents('a').addclass('fancybox')
$("a.fancybox").fancybox();
$('.index_review').each(function(){
if($(this).find('.review_items').length>0){
var swiper = new swiper($(this).find('.review_items'), {
direction: 'vertical',
slidesperview: 1,
slidespercolumn: 2,
speed: 1000,
autoplay: {
delay: 4000,
disableoninteraction: false,
},
navigation: {
nextel: $(this).find('.btn_next'),
prevel: $(this).find('.btn_prev'),
},breakpoints: {
768: {
direction: 'horizontal',
slidesperview:2,
slidespercolumn: 1,
},
480: {
direction: 'horizontal',
slidesperview: 1,
slidespercolumn: 1,
}
}
});
}
})
if($('.page_news').length>0){
var _this=$('.page_news')
var myswiper = new swiper(_this,{
slidesperview: 5,
spacebetween:40,
pagination: {
el:_this.find('.swiper_pagination') ,
clickable: true,
},
navigation: {
nextel: $('.slider_banner_next'),
prevel: $('.slider_banner_prev'),
},
breakpoints: {
768: {
slidesperview: 2
},
480: {
slidesperview: 1
}
}
});
}
if($('.page_partner .layout').length>0){
var _this=$('.page_partner .layout')
var myswiper = new swiper(_this,{
slidesperview: 5,
spacebetween:40,
pagination: {
el:_this.find('.swiper_pagination') ,
clickable: true,
},
breakpoints: {
768: {
slidesperview: 2
},
480: {
slidesperview: 1
}
}
});
}
if($('.news_slide').length>0){
var _this=$('.news_slide')
var myswiper = new swiper(_this,{
effect: 'fade',
speed: 1000,
loop:true,
autoplay: {
delay: 3500,
disableoninteraction: false,
},
pagination: {
el:_this.find('.swiper_pagination') ,
clickable: true,
},
navigation: {
nextel: $('.slider_banner_next'),
prevel: $('.slider_banner_prev'),
}
});
}
if($('.news_wrap').length>0){
var _this=$('.news_wrap')
var myswiper = new swiper(_this,{
effect: 'fade',
speed: 1000,
loop:true,
autoplay: {
delay: 3500,
disableoninteraction: false,
},
pagination: {
el:_this.find('.swiper_pagination') ,
clickable: true,
},
navigation: {
nextel: $('.slider_banner_next'),
prevel: $('.slider_banner_prev'),
}
});
}
certifyswiper = new swiper('#certify .swiper-container', {
watchslidesprogress: true,
slidesperview: 'auto',
centeredslides: true,
loop: true,
loopedslides: 5,
//autoplay: true,
navigation: {
nextel: '.company_next',
prevel: '.company_prev',
},
on: {
progress: function(progress) {
for (i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i);
var slideprogress = this.slides[i].progress;
modify = 1;
if (math.abs(slideprogress) > 1) {
modify = (math.abs(slideprogress) - 1) * 0.3 + 1;
}
if(window.innerwidth>1366){
translate = slideprogress * 411 + 'px';
}else{
translate = slideprogress * 298 + 'px';
}
scale = 1 - math.abs(slideprogress) / 13;
zindex = 999 - math.abs(math.round(10 * slideprogress));
slide.transform('translatex(' + translate + ') scale(' + scale + ')');
slide.css('zindex', zindex);
slide.css('opacity', 1);
if (math.abs(slideprogress) > 3) {
slide.css('opacity', 0);
}
if ( slideprogress < 0 || slideprogress >2) {
slide.css('opacity', 0);
}
}
},
settransition: function(transition) {
for (var i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i)
slide.transition(transition);
}
}
}
})
$('.head_nav li,.product_nav li').each(function(){
if($(this).find('ul').length>0){
$(this).children('a').append("")
}
})
$('.product_category').each(function(){
var title=$(this).find('.category_title h2')
var content=$(this).find('.product_items_wrap')
title.on('click',function(){
$(this).addclass('current').siblings().removeclass('current')
content.eq($(this).index()).addclass('current').siblings().removeclass('current')
})
})
$('.index_news').each(function(){
var title=$(this).find('.news_title .title')
var content=$(this).find('.news_content')
title.on('click',function(){
$(this).addclass('current').siblings().removeclass('current')
content.eq($(this).index()).addclass('current').siblings().removeclass('current')
})
})
/*itemshow('.news_content',1)*/
function itemshow(wrap,itemnum){
$(wrap).each(function(){
var item=$(this).find('ul li')
var more=$(this).find('.more_line')
if(item.length<=itemnum+1){more.hide()}else{more.show()}
item.each(function(index){
if(index>itemnum){
$(this).hide()
}
})
more.click(function(){
if(item.is(':hidden')){
item.show()
}else{
$(this).parents(wrap).find("li:gt("+itemnum+")").hide()
}
})
})
}
tabcontainer('.tab-content-wrap','.tab-title','.tab-panel')
function hidemsgpop(){$('.inquiry-pop-bd').fadeout('fast')}
if($('body .inquiry-form-wrap').length>0){
var webtop=$('body .inquiry-form-wrap').offset().top-80
$('.product-btn-wrap .email,.company_subscribe .button,.side_content .side_list .email').click(function(){
$("html, body").animate({ scrolltop:webtop }, 1000);
$(".ad_prompt").show().delay(3000).hide(300);
})
}else{
$('.product-btn-wrap .email,.foot_items .foot_item.foot_logo .button a,.side_content .side_list .email').click(function(){
$('.inquiry-pop-bd').fadein('fast')
})
}
$('.inquiry-pop,.product-btn-wrap .email,.foot_items .foot_item.foot_logo .button a,.foot_contact .button,.side_content .side_list .email').click(function(e) {e.stoppropagation();})
$(document).click(function() {hidemsgpop()})
function changeurl(link){
var cururl=document.location.href;
var oldurl=window.location.host+'/';
var lgarr=['fr/','de/','pt/','es/','ru/','ko/','ar/','ga/','ja/','el/','tr/','it/','da/','ro/','id/','cs/','af/','sv/','pl/','eu/','ca/','eo/','hi/','lo/','sq/','am/','hy/','az/','be/','bn/','bs/','bg/','ceb/','ny/','co/','hr/','nl/','et/','tl/','fi/','fy/','gl/','ka/','gu/','ht/','ha/','haw/','iw/','hmn/','hu/','is/','ig/','jw/','kn/','kk/','km/','ku/','ky/','la/','lv/','lt/','lb/','mk/','mg/','ms/','ml/','mt/','mi/','mr/','mn/','my/','ne/','no/','ps/','fa/','pa/','sr/','st/','si/','sk/','sl/','so/','sm/','gd/','sn/','sd/','su/','sw/','tg/','ta/','te/','th/','uk/','ur/','uz/','vi/','cy/','xh/','yi/','yo/','zu/','zh-cn/','zh-tw/','zh/'];
$.each(lgarr,function(i,lenitem){
var lgurl=oldurl.tostring()+lenitem;
if(cururl.indexof(lgurl)!=-1){
link.each(function(i){
if(!$(this).parents().hasclass('language-flag')){
var ilink;
if($(this).prop('href')){
ilink=$(this).prop('href');
}
if(string(ilink).indexof(oldurl)!=-1 && string(ilink).indexof(lgurl)==-1 && cururl.indexof(lgurl)!=-1){
var newlink=ilink.replace(oldurl,lgurl);
$(this).attr('href',newlink);
}
}
})
}
});
}
$(function(){
changeurl($('a'));
})
$(document).ready(function(){
$('.change-language .change-language-cont').append("
untranslated
")
$('.prisna-wp-translate-seo').append("more language
")
if($('body .prisna-wp-translate-seo').length>0 && $('.change-language .prisna-wp-translate-seo').length<1){
$('.prisna-wp-translate-seo').appendto('.change-language .change-language-cont')
if($('.change-language .change-language-cont .prisna-wp-translate-seo li').length>0){
$('.change-language .change-language-cont .change-empty').hide()
$('.change-language .change-language-cont .prisna-wp-translate-seo li').each(function(index){
if(index>35 ){
$(this).addclass('lang-item lang-item-hide')
$('.change-language-cont').find('.lang-more').fadein()
}else{
$('.change-language-cont').find('.lang-more').fadeout()
}
})
if($('.change-language-cont .lang-more').length>0){
$('.change-language-cont .lang-more').click(function(){
if($(this).parents('.change-language-cont').find('.prisna-wp-translate-seo li.lang-item').hasclass('lang-item-hide')){
$(this).parents('.change-language-cont').find('.prisna-wp-translate-seo li.lang-item').removeclass('lang-item-hide')
$(this).text('×')
}else{
$(this).parents('.change-language-cont').find('.prisna-wp-translate-seo li.lang-item').addclass('lang-item-hide')
$(this).text('more language')
}
})
}
}else{
$('.change-language .change-language-cont .change-empty').fadein()
}
}
})
var mheadtop=$('.web_head').offset().top
var $backtotoptxt="top", $backtotopele = $('').appendto($("body"))
.html(''+$backtotoptxt+'').attr("title", $backtotoptxt).click(function() {
$("html, body").animate({ scrolltop:0 }, 600);
}), $backtotopfun = function() {
var st = $(document).scrolltop(), winh = $(window).height();
(st > mheadtop)? $backtotopele.addclass('active'): $backtotopele.removeclass('active');
if (!window.xmlhttprequest) {
$backtotopele.css("top", st + winh - 210);
}
};
$(window).bind("scroll", $backtotopfun);
$(function() { $backtotopfun();});
var $nav = $('.web_head'), navtop = $nav.outerheight(), navh = $('.nav_wrap').outerheight(),wintop_1=0,winwidth=$(window).width(),winheight=$(window).height(),spr=$('body').height()-$nav.height();
$(window).on('scroll',function(){
var wintop_2 = $(window).scrolltop();
if(wintop_2>navtop && winwidth>980){
$nav.addclass('fixed-nav');
$nav.parents('body').addclass('fixed-body');
settimeout(function(){$nav.addclass('fixed-nav-active')});
}else{
$nav.removeclass('fixed-nav fixed-nav-active');
$nav.parents('body').removeclass('fixed-body');
}
if(wintop_2>wintop_1 && winwidth>980){
$nav.removeclass('fixed-nav-appear');
}else if(wintop_20){
$('.mobile-head-items').append('')
}
$('.mobile-head-item').each(function(){
$(this).find('.title').click(function(){
if($(this).parents('.mobile-head-item').find('.main-content-wrap').length>0){
var pitem=$(this).parents('.mobile-head-item')
if(!pitem.find('.main-content-wrap').hasclass('show-content-wrap')){
pitem.find('.main-content-wrap').addclass('show-content-wrap')
pitem.find('.side-content-wrap').stop().animate({'left':'0'},300)
pitem.find('.middle-content-wrap').addclass('middle-show-content-wrap')
pitem.find('.side-content-wrap').append("")
pitem.siblings('.mobile-head-item').find('.main-content-wrap').removeclass('show-content-wrap')
pitem.siblings('.mobile-head-item').find('.side-content-wrap').stop().animate({'left':'-70%'},300)
pitem.siblings('.mobile-head-item').find('.middle-content-wrap').removeclass('middle-show-content-wrap')
pitem.siblings('.mobile-head-item').find('.side-content-wrap .mobile-ico-close').remove()
if($('.mobile-head-items').find('.mobile-body-mask').length<1){
$('.mobile-head-items').append('')
}
}
else{
pitem.find('.main-content-wrap').removeclass('show-content-wrap')
pitem.find('.side-content-wrap').stop().animate({'left':'-70%'},300)
pitem.find('.middle-content-wrap').removeclass('middle-show-content-wrap')
pitem.find('.side-content-wrap .mobile-ico-close').remove()
}
$('.mobile-body-mask').click(function(){
$('.mobile-body-mask').remove()
$('.mobile-head-item .main-content-wrap').removeclass('show-content-wrap')
$('.mobile-head-item .side-content-wrap').animate({'left':'-70%'},300)
$('.mobile-head-item .middle-content-wrap').removeclass('middle-show-content-wrap')
$('.mobile-head-item .side-content-wrap .mobile-ico-close').remove()
})
$('.mobile-ico-close').click(function(){
$('.mobile-body-mask').remove()
$('.mobile-head-item .main-content-wrap').removeclass('show-content-wrap')
$('.mobile-head-item .side-content-wrap').stop().animate({'left':'-70%'},300)
$('.mobile-head-item .middle-content-wrap').removeclass('middle-show-content-wrap')
$('.mobile-head-item .side-content-wrap .mobile-ico-close').remove()
})
}
})
})
$('.change-currency ').clone().appendto('.mobile-head-item.mobile-head-currency .main-content-wrap .content-wrap')
$('.change-language .change-language-cont').clone().appendto('.mobile-head-item.mobile-head-language .main-content-wrap .content-wrap')
$('.nav_wrap .head_nav').clone().appendto('.mobile-head-item.mobile-head-nav .main-content-wrap .content-wrap')
$('.head-search-form').clone().appendto('.mobile-head-item.mobile-head-search .main-content-wrap .content-wrap')
$('.head_sns').clone().appendto('.mobile-head-item.mobile-head-social .main-content-wrap .content-wrap')
$('.aside .aside-wrap').clone().appendto('.mobile-head-item.mobile-head-aside .main-content-wrap .content-wrap')
}
}
//mobile end
else {
$(document).ready(function(){
$('.mobile-body-mask,.mobile-head-items,.mobile-head-items,.mobile-nav-items,.mobile-cart-items,.mobile-tab-items').remove()
});
}
}
$(function(){msizechange();})
$(window).resize(function() {msizechange()});
/*tabcontainer*/
function tabcontainer(container,title,panel){$(container).each(function(){$(this).find(title).each(function(){if($(this).hasclass('current')){j=$(this).index();$(this).parents(container).find(panel).eq(j).removeclass('disabled')}$(this).click(function(){i=$(this).index();$(this).addclass('current').siblings().removeclass('current');$(this).parents(container).find(panel).eq(i).show();$(this).parents(container).find(panel).not($(this).parents(container).find(panel).eq(i)).hide();})})})}
$('table').each(function(){
if(!$(this).parent().hasclass('table_wrap')){
$(this).wrap("/div>")
}
})
$(".fancybox").fancybox();
$('.fancybox-media')
.attr('rel', 'media-gallery')
.fancybox({
openeffect : 'none',
closeeffect : 'none',
preveffect : 'none',
nexteffect : 'none',
arrows : false,
helpers : {
media : {},
buttons : {}
}
});
$(document).ready(function(){
$('.banner_flexslider').flexslider({
animation:"fade",
direction:"horizontal",
animationloop:true,
slideshow:true,
slideshowspeed:5000,
animationspeed: 600,
controlnav:true,
touch: true
});
$('.page_vedio .video_info video').click(function(){
if(this.paused){
this.play();
}else{
this.pause();
}
})
})
/*--------------------head-search---------------------*/
$(function(){
$('.search-toggle').on('click',function(){
var hdsearch = $(this).parents(".head-search");
if(hdsearch.hasclass('head-search-show')){
hdsearch.removeclass('head-search-show');
$(this).prop('title','');
}
else{
hdsearch.addclass('head-search-show');
$(this).prop('title','关闭');
}
})
$('.head-search').on('click',function(e){
e.stoppropagation();
})
$(document).on('click',function(){
$('.head-search').removeclass('head-search-show');
$('.head-search .search-toggle').prop('title','');
})
})
$(function(){
$('.akordeon_item').each(function(index){
var title=$(this).find('.arrow')
var content=$(this).find('.item_body')
/*
if(index==3){
$(this).removeclass('disable')
content.css('display','block')
} */
title.click(function(){
if(content.is(':hidden')){
$(this).addclass('current').text('收缩')/*.parents('.company_service').siblings('.company_service').find('.service_title').removeclass('current')*/
content.slidedown()/*.parents('.company_service').siblings('.company_service').find('.company_content').slideup()*/
}else{
$(this).removeclass('current').text('展开')
content.slideup()
}
})
})
})
$('.akordeon_item').each(function() {
var title=$(this).find('.akordeon_title_bar h3')
title.width(100/($(this).find('.akordeon_title_bar h3').length)+'%')
title.each(function(index){
if(index==0){
$(this).addclass('current')
}
})
$(this).find('.akordeon_wrap .akordeon_content').eq(0).addclass('current')
title.on('click',function(){
$(this).addclass('current').siblings("h3").removeclass('current')
var i=$(this).index()
$(this).parents('.akordeon_item').find('.akordeon_wrap .akordeon_content').eq(i).addclass('current').siblings(".akordeon_content").removeclass('current')
})
})
$(".page_news_items .page_news_item").each(function(index){
if(index==0 || index== 1){
$(this).appendto('.news_item_wrap.news_wrap')
}
})