PageSourceSearch

https://www.chunkerowaterplant.com/template/nmoban90/js/common.js

js chunkerowaterplant.com collected 2026-10-04 17:35:26 UTC 20,551 bytes, 452 lines download raw bytes

1
2/*Swiper Banner*/
3if($('.swiper-wrapper .swiper-slide').length<2){$('.swiper-pagination').hide()}
4var mySwiper = new Swiper('.slider_banner',{
5	effect: 'fade',
6    speed: 1000,
7	loop:true,
8	autoplay: {
9       delay: 113500,
10       disableOnInteraction: false,
11    },
12      pagination: {
13        el: '.slider_banner .swiper-pagination',
14        clickable: true,
15      },
16	navigation: {
17        nextEl: '.slider_banner .swiper-button-next',
18        prevEl: '.slider_banner .swiper-button-prev',
19    },
20    on:{
21	    init: function(){
22	      var _that=this;
23	      setCurPage('.slider_banner',_that)
24	    }
25  	}
26  });
27mySwiper.on('slideChange', function () {
28	setCurPage('.slider_banner',mySwiper)
29});
30function setCurPage(sliderWrap,ele){
31	var curIndex=ele.realIndex+1;
32	var total=ele.slides.length-2;
33	var curHtml='<i class="cur">'+curIndex+'</i>'+'<b class="line">/</b>'+'<i class="total">'+total+'</i>';
34	$(sliderWrap).find('.slide-page-box').html(curHtml);
35}
36 var swiper = new Swiper('.company_intr_img_slide', {
37	 effect: 'fade',
38    speed: 1000,
39	loop:true,
40	autoplay: {
41       delay: 3500,
42       disableOnInteraction: false,
43     },
44	autoplay: {
45       delay: 3500,
46       disableOnInteraction: false,
47     }
48    });
49
50var viewSwiper = new Swiper('.image-additional', {
51	  slidesPerView: 3,
52      spaceBetween: 0,
53      pagination: {
54        el: '.product-view .swiper-pagination',
55        clickable: true,
56      },
57	  navigation: {
58        nextEl: '.product-view .swiper-button-next',
59        prevEl: '.product-view .swiper-button-prev',
60      },
61	  breakpoints: {
62	  	1366: {
63          slidesPerView: 3
64        },
65        768: {
66          slidesPerView: 3
67        },
68        480: {
69          slidesPerView: 1
70        }
71      }
72    });
73var realtedSwiper = new Swiper('.goods-may-like .swiper-slider', {
74	  slidesPerView: 3,
75      spaceBetween:20,
76      speed: 400,
77	  navigation: {
78        nextEl: '.goods-may-like .swiper-button-next',
79        prevEl: '.goods-may-like .swiper-button-prev',
80      },
81	  breakpoints: {
82	  	1680: {
83          slidesPerView:3
84        },
85        768: {
86          slidesPerView: 2
87        },
88        480: {
89          slidesPerView: 2,
90          spaceBetween: 10
91        }
92
93      }
94    });	
95$('.head_nav li').each(function(){
96		if($(this).find('ul').length>0){
97		$(this).children('a').append("<b></b>")
98	}
99}) 
100tabContainer('.tab-content-wrap','.tab-title','.tab-panel')
101function hideMsgPop(){$('.inquiry-pop-bd').fadeOut('fast')}
102	if($('body .inquiry-form-wrap').length>0){
103		var webTop=$('body .inquiry-form-wrap').offset().top-80
104		$('.product-btn-wrap .email,.company_subscribe .button,.side_content .side_list .email').click(function(){
105			 $("html, body").animate({ scrollTop:webTop }, 1000);
106			 $(".ad_prompt").show().delay(3000).hide(300);
107			})
108		}else{
109			$('.product-btn-wrap .email,.company_subscribe .button,.side_content .side_list .email').click(function(){
110				$('.inquiry-pop-bd').fadeIn('fast')
111				})
112			}
113$('.inquiry-pop,.product-btn-wrap .email,.company_subscribe .button,.side_content .side_list .email').click(function(e) {e.stopPropagation();})
114$(document).click(function() {hideMsgPop()})
115function changeuRL(link){
116	var curUrl=document.location.href; 
117 	var oldUrl=window.location.host+'/';
118 	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/'];
119	$.each(lgArr,function(i,lenItem){  
120		var lgUrl=oldUrl.toString()+lenItem;
121		if(curUrl.indexOf(lgUrl)!=-1){
122			link.each(function(i){
123				if(!$(this).parents().hasClass('language-flag')){
124					var iLink;
125					if($(this).prop('href')){
126						iLink=$(this).prop('href');
127					}
128					if(String(iLink).indexOf(oldUrl)!=-1 &&  String(iLink).indexOf(lgUrl)==-1 && curUrl.indexOf(lgUrl)!=-1){
129						var newLink=iLink.replace(oldUrl,lgUrl);
130						$(this).attr('href',newLink);
131					}
132				}
133			})
134		}
135	}); 
136}
137$(function(){
138	changeuRL($('a'));
139})
140var mHeadTop=$('.nav_head').offset().top
141    var $backToTopTxt="", $backToTopEle = $('<span class="gotop"></span>').appendTo($("body"))
142        .html('<em>'+$backToTopTxt+'</em>').attr("title", $backToTopTxt).click(function() {
143            $("html, body").animate({ scrollTop:0 }, 600);
144    }), $backToTopFun = function() {	
145        var st = $(document).scrollTop(), winh = $(window).height();
146        (st > mHeadTop)? $backToTopEle.addClass('active'): $backToTopEle.removeClass('active');  		
147        if (!window.XMLHttpRequest) {
148            $backToTopEle.css("top", st + winh - 210); 
149        }
150    };
151 $(window).bind("scroll", $backToTopFun);
152    $(function() { $backToTopFun();});
153  
154	var $nav = $('.nav_head'), navTop = $('.nav_w').offset().top, headH=$nav.outerHeight(), headInnerH=$nav.height(), winTop_1=0,winWidth=$(window).width(),winHeight=$(window).height(),spr=$('body').height()-$nav.height(), holder=jQuery('<div class="head_holder">');
155		$(window).on('scroll',function(){
156			var winTop_2 = $(window).scrollTop();
157			holder.css('height',headH);
158			
159			if(winTop_2>headH+30 && winWidth>980){
160				holder.show().appendTo($nav);
161				$nav.addClass('fixed-nav');
162				$nav.parents('body').addClass('fixed-body');
163				setTimeout(function(){$nav.addClass('fixed-nav-active')});
164			}else{
165				holder.hide();
166				$nav.removeClass('fixed-nav fixed-nav-active');
167				$nav.parents('body').removeClass('fixed-body');
168			}
169			
170			if(winTop_2>winTop_1 && winWidth>980){
171				$nav.removeClass('fixed-nav-up');
172			}else if(winTop_2<winTop_1){
173				$nav.addClass('fixed-nav-up');
174			}
175			winTop_1 = $(window).scrollTop();
176		})   
177$('.faq-item').each(function(index){
178		var _this=$(this)
179		var title=_this.find('.faq-title')
180		var cont=_this.find('.faq-cont')
181		if(index==0){
182			title.addClass('show-title')
183			}
184		title.on('click',function(){
185			if(cont.is(':hidden') && !$(this).hasClass('show-title')){
186				cont.slideDown('fast')
187				$(this).addClass('show-title')
188				_this.siblings().find('.faq-title').removeClass('show-title')
189				_this.siblings().find('.faq-cont').slideUp('fast')
190				}
191				else{
192					cont.slideUp('fast')
193					$(this).removeClass('show-title')
194					}
195			})
196		}) 
197    function mSizeChange()
198    {
199        if (window.innerWidth)
200            winWidth = window.innerWidth;
201        else if ((document.body) && (document.body.clientWidth))
202            winWidth = document.body.clientWidth;
203        if (window.innerHeight)
204            winHeight = window.innerHeight;
205        else if ((document.body) && (document.body.clientHeight))
206            winHeight = document.body.clientHeight;
207        if (document.documentElement  && document.documentElement.clientHeight && document.documentElement.clientWidth)
208        {
209            winHeight = document.documentElement.clientHeight;
210            winWidth = document.documentElement.clientWidth;
211        }
212        if(winWidth<=950){
213            if($('.phone-head-items').length<1){
214                var mobileService='<div class="phone-head-items"><div class="phone-head-item phone-head-nav"><div class="title"></div><div class="main-content-wrap side-content-wrap"><div class="content-wrap"></div></div></div><div class="phone-head-item phone-head-language"><div class="title"></div><div class="main-content-wrap side-content-wrap"><div class="content-wrap"></div></div></div><div class="phone-head-item phone-head-search"><div class="title"></div><div class="main-content-wrap middle-content-wrap"><div class="content-wrap"></div></div></div>'
215                $('body').append(mobileService)
216                if($('body .aside').length>0){
217                    $('.phone-head-items').append('<div class="phone-head-item phone-head-aside"><div class="title"></div><div class="main-content-wrap side-content-wrap"><div class="content-wrap"></div></div></div>')
218                }
219                $('.phone-head-item').each(function(){
220                    $(this).find('.title').click(function(){
221                        if($(this).parents('.phone-head-item').find('.main-content-wrap').length>0){
222                            var pItem=$(this).parents('.phone-head-item')
223                            if(!pItem.find('.main-content-wrap').hasClass('show-content-wrap')){
224                                pItem.find('.main-content-wrap').addClass('show-content-wrap')
225                                pItem.find('.side-content-wrap').stop().animate({'left':'0'},300)
226                                pItem.find('.middle-content-wrap').addClass('middle-show-content-wrap')
227                                pItem.find('.side-content-wrap').append("<b class='mobile-ico-close'></b>")
228                                pItem.siblings('.phone-head-item').find('.main-content-wrap').removeClass('show-content-wrap')
229                                pItem.siblings('.phone-head-item').find('.side-content-wrap').stop().animate({'left':'-90%'},300)
230                                pItem.siblings('.phone-head-item').find('.middle-content-wrap').removeClass('middle-show-content-wrap')
231                                pItem.siblings('.phone-head-item').find('.side-content-wrap .mobile-ico-close').remove()
232                                if($('.phone-head-items').find('.mobile-body-mask').length<1){
233                                    $('.phone-head-items').append('<div class="mobile-body-mask"></div>')
234                                }
235                            }
236                            else{
237                                pItem.find('.main-content-wrap').removeClass('show-content-wrap')
238                                pItem.find('.side-content-wrap').stop().animate({'left':'-90%'},300)
239                                pItem.find('.middle-content-wrap').removeClass('middle-show-content-wrap')
240                                pItem.find('.side-content-wrap .mobile-ico-close').remove()
241                            }
242                            $('.mobile-body-mask').click(function(){
243                                $('.mobile-body-mask').remove()
244                                $('.phone-head-item .main-content-wrap').removeClass('show-content-wrap')
245                                $('.phone-head-item .side-content-wrap').animate({'left':'-90%'},300)
246                                $('.phone-head-item .middle-content-wrap').removeClass('middle-show-content-wrap')
247                                $('.phone-head-item .side-content-wrap .mobile-ico-close').remove()
248                            })
249                            $('.mobile-ico-close').click(function(){
250                                $('.mobile-body-mask').remove()
251                                $('.phone-head-item .main-content-wrap').removeClass('show-content-wrap')
252                                $('.phone-head-item .side-content-wrap').stop().animate({'left':'-90%'},300)
253                                $('.phone-head-item .middle-content-wrap').removeClass('middle-show-content-wrap')
254                                $('.phone-head-item .side-content-wrap .mobile-ico-close').remove()
255                            })
256                        }
257                    })
258                })
259                $('.change-currency ').clone().appendTo('.phone-head-item.phone-head-currency .main-content-wrap .content-wrap')
260                $('.c-language .c-language-cont').clone().appendTo('.phone-head-item.phone-head-language .main-content-wrap .content-wrap')
261                $('.nav_w .head_nav').clone().appendTo('.phone-head-item.phone-head-nav .main-content-wrap .content-wrap')
262                $('.head-search:last').clone().appendTo('.phone-head-item.phone-head-search .main-content-wrap .content-wrap')
263				$('.head_sns').clone().appendTo('.phone-head-item.phone-head-social .main-content-wrap .content-wrap')
264                $('.aside .aside-wrap').clone().appendTo('.phone-head-item.phone-head-aside .main-content-wrap .content-wrap')
265            }
266        }
267        //mobile end
268        else {
269            $(document).ready(function(){
270            $('.mobile-body-mask,.phone-head-items,.phone-head-items,.mobile-nav-items,.mobile-cart-items,.mobile-tab-items').remove()
271            });
272        } 
273    }
274$(function(){mSizeChange();})
275$(window).resize(function() {mSizeChange()});
276/*side*/
277$(function(){
278$('.side-widget .side-cate li').each(function(){
279		if($(this).find('ul').length>0){
280			$(this).append("<span class='icon-cate icon-cate-up'></span>")
281			$(this).children('.icon-cate').click(function(e){
282				if($(this).parent('li').children('ul').is(':hidden')){
283					
284					    $(this).parent('li').children('ul').slideDown(100);
285						$(this).removeClass('icon-cate-up').addClass('icon-cate-down');
286					}else{
287						$(this).parent('li').children('ul').slideUp(100);
288						$(this).removeClass('icon-cate-down').addClass('icon-cate-up');
289						}
290						e.stopPropagation();
291				})
292			}
293		})
294	
295		if($('.side-widget .side-cate .nav-current').parents('ul').length>0 && $('.side-widget .side-cate .nav-current').find('ul').length>0) {
296		$('.side-widget .side-cate .nav-current').parents('ul').show()
297		$('.side-widget .side-cate .nav-current').parents('li').addClass("show_li")
298		$('.side-widget .side-cate .nav-current').parents('li.show_li').children('.icon-cate').removeClass('icon-cate-down').addClass('icon-cate-up')
299		$('.side-widget .side-cate .nav-current').children('ul').show()
300		$('.side-widget .side-cate .nav-current ').children('.icon-cate').removeClass('icon-cate-down').addClass('icon-cate-up');
301		}
302		 else if($('.side-widget .side-cate .nav-current').parents('ul').length>0 && $('.side-widget .side-cate .nav-current').find('ul').length<1){
303			 $('.side-widget .side-cate .nav-current').parents('ul').show()
304			 $('.side-widget .side-cate .nav-current').parents('li').addClass("show_li")
305			 $('.side-widget .side-cate .nav-current').parents('li.show_li').children('.icon-cate').removeClass('icon-cate-down').addClass('icon-cate-up')
306			}
307		 else if($('.side-widget .side-cate .nav-current').parents('ul').length<1 && $('.side-widget .side-cate .nav-current').find('ul').length>0){
308			$('.side-widget .side-cate .nav-current').children('ul').show()
309			$('.side-widget .side-cate .nav-current').children('.icon-cate').removeClass('icon-cate-down').addClass('icon-cate-up');
310			}
311})
312/*tabContainer*/
313function 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();})})})}
314/*search*/
315document.documentElement.className='js';;(function(window){if(document.querySelector('.nav-search')){'use strict';var mainContainer=document.querySelector('.container'),searchContainer=document.querySelector('.nav-search'),openCtrl=document.getElementById('btn-search'),closeCtrl=document.getElementById('btn-search-close'),inputSearch=searchContainer.querySelector('.search-ipt');function init(){initEvents()}function initEvents(){
316	openCtrl.addEventListener('click',function(){if(!searchContainer.classList.contains("search--open")){openSearch();}else{openSearch();}});
317	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);
318
319
320$(function() { $("#scrollsidebar").fix({float : 'right',durationTime : 400 });}); 
321$('.business_right .events li').on('click',function(){
322	$(this).addClass('current').siblings("li").removeClass('current')
323	var i=$(this).index()
324	$(this).parents('.index_business').find('.business_middle .tab_content').eq(i).addClass('current').siblings(".tab_content").removeClass('current')
325})
326$('table').each(function(){
327		 if(!$(this).parent().hasClass('table_wrap')){
328			 	$(this).wrap("<div class='table_wrap'><//div>")
329			 }
330		 })
331
332
333
334/* -------------- header --------------*/
335
336// dropmenu direction
337$(function(){
338	menuDirection('.head_nav>li');
339	$(window).on('resize',function(){
340		menuDirection('.head_nav>li');
341	})
342})
343function menuDirection(ele){
344	var winW=$(window).innerWidth();
345	$(ele).each(function(){
346		if($(this).find('ul').length){
347			var linkEleW=$(this).children('a').width();
348			var offRight=winW-$(this).offset().left;
349			var childLen=$(this).find('ul').length;
350			var childrenWidth=childLen*250+10;
351			if(offRight<childrenWidth){
352				$(this).addClass('menu_left');
353			}
354			else{
355				$(this).removeClass('menu_left');
356			}
357		}
358	})	
359}
360
361
362
363
364/* -------------- index --------------*/
365
366// var pdSwiper = new Swiper('.recommend_slider', {
367//   slidesPerView: 1,
368//   speed:400,
369//   loop:false,
370//   spaceBetween: 2,
371//   initialSlide:0,
372//   pagination: {
373//     el: '.index_recommend .swiper-pagination',
374//     clickable: true,
375//   },
376//   navigation: {
377//     nextEl: '.index_recommend .swiper-button-next',
378//     prevEl: '.index_recommend .swiper-button-prev',
379//   },
380//   breakpoints: {
381//   	950: {
382//       // loop: true
383//     }
384//   }
385// });
386
387
388// TABS
389$(function(){})
390	$('.project_tabs li').on('click',function(){
391		$(this).addClass('active').siblings('li').removeClass('active');
392		var tabIndex=$(this).index();
393		var tabWrap=$(this).parents('.index_project');
394		tabWrap.find('.tab_panel').eq(tabIndex).show().siblings('.tab_panel').hide();
395		tabWrap.find('.tab_panel').eq(tabIndex).addClass('panel_active').siblings('.tab_panel').removeClass('panel_active');
396		// tabWrap.find('.tab_panel').find('.product_item').removeClass('wow fadeInUpA');
397		// tabWrap.find('.tab_panel').eq(tabIndex).find('.product_item').addClass('wow fadeInUpA');
398	})
399
400
401
402
403/* -------------- subpage --------------*/
404
405var sideProduct = new Swiper('.side_slider', {
406  slidesPerView: 5,
407  slidesPerGroup:1,
408  spaceBetween: 0,
409  direction: 'vertical',
410  navigation: {
411    nextEl: '.side-product-items .btn-next',
412    prevEl: '.side-product-items .btn-prev',
413  },
414  pagination: {
415    el: '.side-product-items .swiper-pagination',
416    clickable: true,
417  },
418});
419
420
421
422var bnSwiper = new Swiper('.main_banner_slider',{
423	effect: 'fade',
424    speed: 1000,
425	loop:true,
426	spaceBetween: 0,
427	autoplay: {
428       delay: 3500,
429       disableOnInteraction: false,
430    },
431	pagination: {
432       el: '.main_banner_slider .swiper-pagination',
433       clickable: true,
434    }
435  });
436
437
438
439// search
440$(function(){
441	$(document).on('click',function(){
442		$('.container').removeClass('main-wrap--move');
443		$('.nav-search').removeClass('search--open');
444	})
445	$('.btn--search,.nav-search').on('click',function(e){
446		e.stopPropagation();
447	})
448})
449
450
451// button
452$(".sys_btn_wave").mouseenter(function(e){var parentOffset=$(this).offset();var relX=e.pageX-parentOffset.left;var relY=e.pageY-parentOffset.top;$(this).find(".btn_wave_circle").css({"left":relX,"top":relY});$(this).find(".btn_wave_circle").removeClass("desplode-circle");$(this).find(".btn_wave_circle").addClass("explode-circle");});$(".sys_btn_wave").mouseleave(function(e){var parentOffset=$(this).offset();var relX=e.pageX-parentOffset.left;var relY=e.pageY-parentOffset.top;$(this).find(".btn_wave_circle").css({"left":relX,"top":relY});$(this).find(".btn_wave_circle").removeClass("explode-circle");$(this).find(".btn_wave_circle").addClass("desplode-circle");});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.