/*swiper banner*/ if ($('.swiper-wrapper .swiper-slide').length < 2) { $('.swiper-pagination').hide() } var myswiper = new swiper('.slider_banner', { effect: 'fade', speed: 1000, loop: true, fadeeffect: { crossfade: true, }, autoplay: { delay: 5000, disableoninteraction: false, }, navigation: { nextel: '.banner_button_next', prevel: '.banner_button_prev', }, pagination: { el: '.slider_banner .swiper-pagination', clickable: true, } }); $(function(){ $(".index_category .article").each(function () { $(this).hover(function () { $(".index_category .article").removeclass('on'); $(this).addclass('on'); }); }); }) var swiper = new swiper('.image-additional', { slidesperview:6, spacebetween: 6, pagination: { el: '.product-view .swiper-pagination', clickable: true, }, navigation: { nextel: '.product-view .swiper-button-next', prevel: '.product-view .swiper-button-prev', }, breakpoints: { 1366: { slidesperview: 4 }, 950: { slidesperview: 3 }, 480: { slidesperview: 1, loop: true } } }) var page_download_swiper = new swiper('.page_download_swiper', { slidesperview:5, spacebetween: 15, breakpoints: { 1366: { slidesperview: 4 }, 950: { slidesperview: 3 }, 480: { slidesperview: 1, loop: true } } }) var page_icon_swiper = new swiper('.page_icon_swiper', { slidesperview:5, spacebetween: 20, breakpoints: { 1366: { slidesperview: 4 }, 950: { slidesperview: 3 }, 480: { slidesperview: 1, loop: true } } }) var page_highlights_swiper = new swiper('.page_highlights_swiper', { slidesperview:4, spacebetween: 0, breakpoints: { 1366: { slidesperview: 4 }, 950: { slidesperview: 3 }, 480: { slidesperview: 1, loop: true } } }) var swiper = new swiper('.index_overall_swiper', { slidesperview: 5, spacebetween: 55, slidespercolumn : 2, slidespercolumnfill : 'row', breakpoints: { 1366: { slidesperview: 4 }, 950: { slidesperview: 3 }, 480: { slidesperview: 1, loop: true } } }) var index_products_swiper = new swiper('.index_products_swiper', { slidesperview: 4, spacebetween: 25, slidespercolumn : 2, slidespercolumnfill : 'row', breakpoints: { 1366: { slidesperview: 4 }, 950: { slidesperview: 3 }, 480: { slidesperview: 1, loop: true } } }) var index_news_swiper = new swiper('.index_news_swiper', { slidesperview:3, spacebetween: 20, breakpoints: { 1366: { slidesperview: 3 }, 950: { slidesperview: 2 }, 640: { slidesperview: 1, loop: true } } }) var relatedswiper = new swiper('.goods-may-like .swiper-slider', { slidesperview: 4, spacebetween:28, speed: 400, pagination:{ el:'.product-pagination', clickable: true, }, navigation: { nextel: '.navigate_button_next', prevel: '.navigate_button_prev', }, breakpoints: { 1680: { slidesperview: 4 }, 1024: { slidesperview: 3 }, 768: { slidesperview: 2 }, 480: { slidesperview: 1, spacebetween: 10 } } }); $('.head_nav li').each(function() { if ($(this).find('ul').length > 0) { $(this).children('a').append(""); $(this).addclass('has-child'); } }) // navigation dropdown menu dropmenu('.head_nav li', 'ul',0,'menu_show'); 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,.button,.side_content .side_list .email ,.inquiry_btn').click(function() { $("html, body").animate({ scrolltop: webtop }, 1000); $(".ad_prompt").show().delay(3000).hide(300); }) } else { $('.product-btn-wrap .email,.button,.side_content .side_list .email ,.inquiry_btn').click(function() { $('.inquiry-pop-bd').fadein('fast') }) } $('.inquiry-pop,.product-btn-wrap .email,.button,.side_content .side_list .email ,.inquiry_btn').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/']; $.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).addclass('more-active').text('x') } else { $(this).parents('.change-language-cont').find('.prisna-wp-translate-seo li.lang-item').addclass('lang-item-hide') $(this).removeclass('more-active').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(); }); $(function() { $(".index_application_list li").mouseenter(function() { var index = $(this).index(); $(".index_application_img_box img").eq(index).addclass("active").siblings().removeclass("active"); }) }) // get window size var winwidth = 0; var winheight = 0; function getwinsize() { if (window.innerwidth) { winwidth = window.innerwidth; } else if ((document.body) && (document.body.clientwidth)) { winwidth = document.body.clientwidth; } if (window.innerheight) { winheight = window.innerheight; } else if ((document.body) && (document.body.clientheight)) { winheight = document.body.clientheight; } if (document.documentelement && document.documentelement.clientheight && document.documentelement.clientwidth) { if (window.innerwidth && window.innerheight) { winwidth = window.innerwidth; winheight = window.innerheight; } else { winheight = document.documentelement.clientheight; winwidth = document.documentelement.clientwidth; } } } getwinsize(); var $nav = $('.web_head'), navtop = $('.nav_wrap').offset().top, headh = $nav.outerheight(), wintop_1 = 0, spr = $('body').height() - $nav.height(), holder = jquery('
'); function fixedtop() { var wintop_2 = $(window).scrolltop(); holder.css('height', $('.head_bottom').outerheight()); if (wintop_2 > headh && winwidth >= 950) { holder.show().appendto($nav); $nav.addclass('fixed-nav'); $nav.parents('body').addclass('fixed-body'); settimeout(function() { $nav.addclass('fixed-nav-active') }); } else { holder.hide(); $nav.removeclass('fixed-nav fixed-nav-active'); $nav.parents('body').removeclass('fixed-body'); } if (wintop_2 > wintop_1 && winwidth >= 950) { $nav.removeclass('fixed-nav-appear'); } else if (wintop_2 < wintop_1) { $nav.addclass('fixed-nav-appear'); } wintop_1 = $(window).scrolltop(); } fixedtop(); $(window).on('scroll', function() { fixedtop(); }) $(window).on('resize', function() { fixedtop(); }) $('.faq-item').each(function(index) { var _this = $(this) var title = _this.find('.faq-title') var cont = _this.find('.faq-cont') if (index == 0) { title.addclass('show-title') } title.on('click', function() { if (cont.is(':hidden') && !$(this).hasclass('show-title')) { cont.slidedown('fast') $(this).addclass('show-title') _this.siblings().find('.faq-title').removeclass('show-title') _this.siblings().find('.faq-cont').slideup('fast') } else { cont.slideup('fast') $(this).removeclass('show-title') } }) }) function msizechange() { getwinsize(); if (winwidth <= 950) { if ($('.mobile-head-items').length < 1) { var mobileservice = '
' $('body').append(mobileservice) if ($('body .aside').length > 0) { $('.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:last').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() }); /*side*/ function sidecate(cateele,siblingsstatus){ $(cateele).each(function() { if ($(this).find('ul').length ) { $(this).addclass('has-child'); $(this).append("") $(this).children('.icon-cate').click(function(e) { var mele=$(this).parent('li'); var mlist=$(this).parent('li').children('ul'); var msiblings=$(this).parent('li').siblings('li'); if(siblingsstatus==0){ msiblings.removeclass('li_active'); msiblings.children('ul').slideup(150); msiblings.children('.icon-cate').removeclass('icon-cate-up').addclass('icon-cate-down'); } if (mlist.is(':hidden')) { mele.addclass('li_active'); mlist.slidedown(150); $(this).removeclass('icon-cate-down').addclass('icon-cate-up'); } else { mele.removeclass('li_active'); mlist.slideup(150); $(this).removeclass('icon-cate-up').addclass('icon-cate-down'); } e.stoppropagation(); }) } }) } $(function() { // side cate sidecate('.side-cate li',0); $('.side-cate,.side-cate ul').each(function(){ if(!$(this).find('ul').length){ $(this).addclass('cate-type-list'); } }) var $currentele=$('.side-widget .side-cate .nav-current'); if ($currentele.parents('ul').length > 0 && $currentele.find('ul').length > 0) { $currentele.parents('ul').show() $currentele.parents('li').addclass("show_li") $currentele.parents('li.show_li').children('.icon-cate').removeclass('icon-cate-down').addclass('icon-cate-up') $currentele.children('ul').show() $('.side-widget .side-cate .nav-current ').children('.icon-cate').removeclass('icon-cate-down').addclass('icon-cate-up'); } else if ($currentele.parents('ul').length > 0 && $currentele.find('ul').length < 1) { $currentele.parents('ul').show() $currentele.parents('li').addclass("show_li") $currentele.parents('li.show_li').children('.icon-cate').removeclass('icon-cate-down').addclass('icon-cate-up') } else if ($currentele.parents('ul').length < 1 && $currentele.find('ul').length > 0) { $currentele.children('ul').show() $currentele.children('.icon-cate').removeclass('icon-cate-down').addclass('icon-cate-up'); } }) /*tabcontainer*/ tabcontainer('.tab-content-wrap', '.tab-title', '.tab-panel'); 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(); }) }) }) } /*search*/ document.documentelement.classname = 'js';; (function(window) { if (document.queryselector('.web-search')) { 'use strict'; var maincontainer = document.queryselector('.container'), searchcontainer = document.queryselector('.web-search'), openctrl = document.getelementbyid('btn-search'), closectrl = document.getelementbyid('btn-search-close'), inputsearch = searchcontainer.queryselector('.search-ipt'); function init() { initevents() } function initevents() { openctrl.addeventlistener('click', function() { if (!searchcontainer.classlist.contains("search--open")) { opensearch(); } else { closesearch(); } }); closectrl.addeventlistener('click', closesearch); document.addeventlistener('keyup', function(ev) { if (ev.keycode == 27) { closesearch() } }) } function opensearch() { maincontainer.classlist.add('main-wrap--move'); searchcontainer.classlist.add('search--open'); settimeout(function() { inputsearch.focus() }, 600) } function closesearch() { maincontainer.classlist.remove('main-wrap--move'); searchcontainer.classlist.remove('search--open'); inputsearch.blur(); inputsearch.value = '' } init() } })(window); $(function() { $("#scrollsidebar").fix({ float: 'right', durationtime: 400 }); }); $('.business_right .events li').on('click', function() { $(this).addclass('current').siblings("li").removeclass('current') var i = $(this).index() $(this).parents('.index_business').find('.business_middle .tab_content').eq(i).addclass('current').siblings(".tab_content").removeclass('current') }) $('table').each(function() { if (!$(this).parent().hasclass('table_wrap')) { $(this).wrap("
") } }) /* -------------- public function --------------*/ /*! 鍒囨崲class ---------- * 璇存槑: * btn: 鎸夐挳 * cont: 鎿嶆帶鐨勫唴瀹? * cname: 鍒囨崲鐨刢lassname * siblingsstatus: 鍚岀骇鏄惁鍏抽棴(0:鍏抽棴,鍏朵粬鍊?涓嶅彈click褰卞搷) */ function toggleclass(btn, cont, cname, hname, siblingsstatus) { var $btn = $(btn); var $cont = $(cont); if (siblingsstatus == 0) { $btn.parents(cont).siblings(cont).removeclass(cname).addclass(hname); } if ($btn.parents(cont).hasclass(cname)) { $btn.parents(cont).removeclass(cname).addclass(hname); } else { $btn.parents(cont).addclass(cname).removeclass(hname); } } // set head nav direction function menudirection(ele) { var winw = $(window).innerwidth(); $(ele).each(function() { if ($(this).find('ul').length) { var linkelew = $(this).children('a').width(); var offright = winw - $(this).offset().left; var childlen = $(this).find('ul').length; var childrenwidth = childlen * 250 + 10; if (offright < childrenwidth) { $(this).addclass('menu_left'); } else { $(this).removeclass('menu_left'); } } }) } // dropmenu function dropmenu(menuitem, menulist,menustatus,showclass) { var mouseover_tid = []; var mouseout_tid = []; if(showclass){ showclass=showclass; } else{ showclass='active'; } $(menuitem).each(function(index) { $(this).hover( function() { var _self = this; cleartimeout(mouseout_tid[index]); mouseover_tid[index] = settimeout(function() { if(menustatus=='1'){ $(_self).children(menulist).slidedown(150); } $(_self).addclass(showclass); }, 150); }, function() { var _self = this; cleartimeout(mouseover_tid[index]); mouseout_tid[index] = settimeout(function() { if(menustatus=='1'){ $(_self).children(menulist).slideup(50); } $(_self).removeclass(showclass); }, 150); } ); }) } /* -------------- header --------------*/ // dropmenu direction $(function() { menudirection('.head_nav>li'); $(window).on('resize', function() { menudirection('.head_nav>li'); }) }) $(function() { $('body').delegate('.head_nav li b', 'click', function() { var navitem = $(this).closest('li'); var navmenu = navitem.children('ul'); if (navmenu.is(':hidden')) { navmenu.slidedown(150, function() { navitem.addclass('active'); }); } else { navitem.removeclass('active'); navmenu.slideup(150); } return false; }) }) /* -------------- index --------------*/ var myswiper = new swiper('.feature_items', { effect: 'slide', slidesperview: 4, spacebetween: 10, navigation: { nextel: '.feature_button_next', prevel: '.feature_button_prev', disabledclass: 'feature-button-disabled', }, pagination: { el: '.feature-pagination', clickable: true, }, breakpoints: { 1280: { spacebetween:10, }, 950: { slidesperview:3, spacebetween:10, }, 640: { slidesperview:2, spacebetween:7, }, 480: { slidesperview:1, spacebetween:0, } } }); /* -------------- subpage 渚ф爮 --------------*/ var sideproduct = new swiper('.side_slider', { slidesperview: 6, slidespergroup: 1, spacebetween:10, direction: 'vertical', navigation: { nextel: '.side-product-items .btn-next', prevel: '.side-product-items .btn-prev', }, pagination: { el: '.side-product-items .swiper-pagination', clickable: true, }, }); $(function(){ $('.page_detail_box .flex_row .right .page_detail_nav ul li').click(function(){ $(this).addclass('active').siblings().removeclass('active') $(this).children('.content').slidedown(300).parent().siblings().children('.content').slideup(300) }) $('.top_features_nav a').click(function(){ $(this).addclass('active').siblings().removeclass('active') $('.top_features_items .top_features_item ').eq($(this).index()).addclass('active').siblings().removeclass('active') }) })