PageSourceSearch

https://www.smartscales.com/res/magic/js/function.js

js smartscales.com collected 2026-10-04 01:50:57 UTC 12,972 bytes, 446 lines download raw bytes

1$(function() {
2    
3    var pageurl = location.href;
4	$("form .pageurl").val(pageurl);
5	var page_title = $('title').text();
6	$("form .page_title").val(page_title);
7    
8    
9    
10	$(window).scroll(function() {
11// 		if ($(window).scrollTop() > $(window).height()) {
12// 			$(".additional-features .db").removeClass("opa-0"); //pc返回顶部
13// 		} else if ($(window).scrollTop() <= $(window).height()) {
14// 			$(".additional-features .db").addClass("opa-0"); //pc返回顶部
15// 		}
16        
17        var scrollTop = $(window).scrollTop();
18        var windowHeight = $(window).height();
19        var documentHeight = $(document).height();
20
21        if (scrollTop < windowHeight || (scrollTop + windowHeight) >= documentHeight) {
22            $(".additional-features").removeClass("opa-0");
23        } else {
24            $(".additional-features").addClass("opa-0");
25        }
26	});
27
28	// JavaScript代码
29
30	//手机端导航点击
31	$(document).on("click", ".mobile-navbtn", function (e) {
32        
33        e.preventDefault();
34        if ($(this).hasClass("open")) {
35          $(this).removeClass("open");
36        } else {
37          $(this).addClass("open");
38        }
39        $(this).parents("a").next(".dropdown").find(".slide-list").slideToggle();
40        $(this).parents("a").next(".dropdown").find(".submen-list").slideToggle();
41    })
42    $('.slideTxtBox .hd .slide-list li a').hover(function() {
43        var thumburl = $(this).attr('data-img');
44        $('.product-box img').attr('src',thumburl);
45    })
46    
47    
48    //产品列表悬浮
49    $(window).bind("scroll", function(){ 
50        var top = $(this).scrollTop();
51        if(top >= 300){
52            $(".page-content .products-box .sidebar").addClass('fixed');
53        }else{
54            $(".page-content .products-box .sidebar").removeClass('fixed');
55        }
56    });
57	$('.db').click(function() {
58		$("html,body").animate({
59			scrollTop: 0
60		}, 500);
61	});
62	$(".additional-features li").hover(function() {
63		$(this).find("span").css({
64			"opacity": "1",
65			"filter": "Alpha(opacity=100)",
66			"display":"block"
67		})
68		$(this).find(".wechat_code").css({
69			"opacity": "1",
70			"filter": "Alpha(opacity=100)",
71			"display":"block"
72		})
73		
74	}, function() {
75		$(this).find("span").css({
76			"opacity": "0",
77			"filter": "Alpha(opacity=0)"
78		})
79		$(this).find(".wechat_code").css({
80			"opacity": "0",
81			"filter": "Alpha(opacity=0)"
82		})
83	});
84	if ($(document.body).width() < 768) {
85		$(".icosearch").click(function() {
86			$("#js-search-overlay").show();
87			$("html").css("overflow", "hidden");
88		})
89		$("#js-search-overlay").click(function() {
90			$("#js-search-overlay").hide();
91			$("html").css("overflow", "auto");
92			$(".navbar").removeAttr("id", "showopen")
93		});
94	}
95	$(".icosearch").click(function() {
96		$(".navbar").attr("id", "showopen")
97	})
98	$(".js-search-btn-close").click(function() {
99		$(".navbar").removeAttr("id", "showopen")
100	})
101	
102	
103})
104//产品详情点击切换
105$(function () {
106    $('.pro-show .content .head-table span').eq(0).addClass('active');
107    $('.product-content-box > div').eq(0).addClass('active');
108    $('.pro-show .content .head-table span').click(function () {
109        $(this).siblings().removeClass('active');
110        $(this).addClass('active');
111        var index = $(this).index();
112        $('.product-content-box > div').eq(index).siblings().removeClass('active');
113        $('.product-content-box > div').eq(index).addClass('active');
114    });
115})
116
117
118// 头部搜索
119$(".search_con2 .search-btn").click(function(){
120    var keyword = $(".search_con2 #q").val();
121    if (keyword) {
122        window.location.href="/index.php?f=search&v=index&modelid=1008&keywords="+keyword;
123    }else{
124        alert("Keywords cannot be empty!");
125    }
126});
127//产品详情组图点击切换
128$(document).ready(function() {
129    $('.pro-show .head .img-box .imagesbox .swiper .swiper-wrapper .swiper-slide').eq(0).find(".item").addClass('active');
130    $('.pro-show .head .img-box .imagesbox .swiper .item').click(function() {
131        if (!$(this).hasClass('active')) {
132            $(this).addClass('active');
133            $(this).parent(".swiper-slide").siblings().find(".item").removeClass('active');
134        }
135        var imageUrl = $(this).find('img').attr('src');
136      $('.pro-show .head .img-box .img-over img').attr('src',imageUrl);
137    });
138});
139// 关于我们
140var Swiper1 = new Swiper('.about-history .swiper', {
141    slidesPerView: 3,
142    slidesPerColumn : 2,
143    slidesPerGroup : 1,
144    autoplay:true,
145    navigation: {
146        nextEl: " .swiper-navigation .swiper-button-next",
147        prevEl: " .swiper-navigation .swiper-button-prev",
148    },
149    breakpoints: {
150        991: {
151            slidesPerView: 2,
152        },
153        768: {
154            slidesPerView: 1,
155            pagination: {
156                el: ".swiper-pagination",
157                clickable: true
158            },
159        },
160    },
161})
162var Swiper2 = new Swiper('.about-certifications .swiper', {
163    slidesPerView : 5, 
164    spaceBetween : 20,
165    autoplay:true,
166    navigation: {
167        nextEl: ".swiper-navigation .swiper-button-next",
168        prevEl: ".swiper-navigation .swiper-button-prev",
169    },
170    breakpoints: {
171        991: {
172            slidesPerView: 4,
173        },
174        768: {
175            slidesPerView: 2,
176            pagination: {
177                el: ".swiper-pagination",
178                clickable: true
179            },
180        },
181    },
182})
183var Swiper3 = new Swiper('.about-factory .factory1 .swiper', {
184    slidesPerView : 4,
185    spaceBetween : 10,
186    autoplay:true,
187    navigation: {
188        nextEl: ".swiper-navigation .swiper-button-next",
189        prevEl: ".swiper-navigation .swiper-button-prev",
190    },
191    breakpoints: {
192        991: {
193            slidesPerView: 3,
194        },
195        768: {
196            slidesPerView: 2,
197            pagination: {
198                el: ".swiper-pagination",
199                clickable: true
200            },
201        },
202    },
203})
204var Swiper4 = new Swiper('.about-factory .factory2 .swiper', {
205    slidesPerView : 4,
206    autoplay:true,
207    spaceBetween : 10,
208    navigation: {
209        nextEl: ".swiper-navigation .swiper-button-next",
210        prevEl: ".swiper-navigation .swiper-button-prev",
211    },
212    breakpoints: {
213        991: {
214            slidesPerView: 3,
215        },
216        768: {
217            slidesPerView: 2,
218            pagination: {
219                el: ".swiper-pagination",
220                clickable: true
221            },
222        },
223    },
224})
225var Swiper5 = new Swiper('.about-factory .factory3 .swiper', {
226    slidesPerView : 4,
227    spaceBetween : 10,
228    autoplay:true,
229    navigation: {
230        nextEl: ".swiper-navigation .swiper-button-next",
231        prevEl: ".swiper-navigation .swiper-button-prev",
232    },
233    breakpoints: {
234        991: {
235            slidesPerView: 3,
236        },
237        768: {
238            slidesPerView: 2,
239            pagination: {
240                el: ".swiper-pagination",
241                clickable: true
242            },
243        },
244    },
245}) 
246var Swiper6 = new Swiper('.about-factory .factory4 .swiper', {
247    slidesPerView : 4,
248    spaceBetween : 10,
249    autoplay:true,
250    navigation: {
251        nextEl: ".swiper-navigation .swiper-button-next",
252        prevEl: ".swiper-navigation .swiper-button-prev",
253    },
254    breakpoints: {
255        991: {
256            slidesPerView: 3,
257        },
258        768: {
259            slidesPerView: 2,
260            pagination: {
261                el: ".swiper-pagination",
262                clickable: true
263            },
264        },
265    },
266})
267var Swiper7 = new Swiper('.about-factory .factory5 .swiper', {
268    slidesPerView : 4,
269    spaceBetween : 10,
270    autoplay:true,
271    navigation: {
272        nextEl: ".swiper-navigation .swiper-button-next",
273        prevEl: ".swiper-navigation .swiper-button-prev",
274    },
275    breakpoints: {
276        991: {
277            slidesPerView: 3,
278        },
279        768: {
280            slidesPerView: 2,
281            pagination: {
282                el: ".swiper-pagination",
283                clickable: true
284            },
285        },
286    },
287})
288var Swiper8 = new Swiper('.productSwiper', {
289    autoplay:true,
290    pagination: {
291        el: ".swiper-pagination",
292        clickable: true
293    },
294    // autoplay: true,
295})
296var Swiper9 = new Swiper('.related-pro .swiper-container', {
297    slidesPerView : 4, 
298    spaceBetween : 10,
299    autoplay:true,
300    navigation: {
301        nextEl: ".swiper-navigation .swiper-button-next",
302        prevEl: ".swiper-navigation .swiper-button-prev",
303    },
304    breakpoints: {
305        991: {
306            slidesPerView: 2,
307            pagination: {
308                el: ".swiper-pagination",
309                clickable: true
310            },
311        },
312    },
313    
314})
315var Swiper10 = new Swiper('.pro-show .imagesbox .swiper', {
316    slidesPerView : 7, 
317    spaceBetween : 10,
318    breakpoints: {
319        991: {
320            slidesPerView: 5,
321        },
322    },
323    
324})
325$(function() {
326    $('.about-factory .swiper-factory > div').hide();
327    $('.about-factory .swiper-factory > div').eq(0).addClass('active');
328    $('.about-factory .swiper-factory > div').eq(0).show();
329    $('.about-factory .sub-categorys li').eq(0).addClass('active');
330    $('.about-factory .sub-categorys li').click(function() {
331        $(this).siblings().removeClass('active');
332        $(this).addClass('active');
333        var index = $(this).index();
334        $('.about-factory .swiper-factory > div').eq(index).siblings().removeClass('active');
335        $('.about-factory .swiper-factory > div').eq(index).addClass('active');
336        $('.about-factory .swiper-factory > div').eq(index).siblings().hide();
337        $('.about-factory .swiper-factory > div').eq(index).show();
338    });
339})
340// 关于我们
341//询盘
342$(function () {
343    shoppingcar();
344    function shoppingcar(){
345        var car = $.cookie('shoppingcar');
346        if (car) {
347          var strCookie = $.cookie('shoppingcar');
348          
349          strCookie = strCookie.substr(0, strCookie.length - 1);
350          var strCookie = strCookie.split(";");
351            var num = strCookie.length;
352            if (num) {
353                $('#quota-num').text(num);
354                $("#product-number").text(num);
355            }else{
356                $('#quota-num').text(0);
357            }
358        }else{
359            $('#quota-num').text(0);
360        }
361    }
362    $(".icon_inquire").click(function(){
363        // window.event.returnValue = false;//禁止跳转
364        var s = $.cookie('shoppingcar');
365        var p = $(this).attr('id')+'<-@->'+$(this).attr('data')+'<-@->'+$(this).attr('img')+'<-@->'+$(this).attr('link')+';';
366        if(s){
367            if(s.indexOf(p) == -1){
368                p = s+p;
369                $.cookie('shoppingcar',p,{ expires: 7, path: '/' });
370                alert('Add Batch Inquiry Succeeded!');
371            }
372            else{
373                alert('The added product already exists. There is no need to add it again!');
374            }
375        }else{
376                $.cookie('shoppingcar',p,{ expires: 7, path: '/' });
377                alert('Add Batch Inquiry Succeeded!');
378        }
379        var strCookie = $.cookie('shoppingcar');
380            if(strCookie){
381                strCookie = strCookie.substr(0, strCookie.length - 1);
382                var arrCookie = strCookie.split(";");
383                var num2 = arrCookie.length;
384            }
385        $('#quota-num').text(num2);
386    });
387})
388// 平滑滚动到目标元素位置
389$(document).ready(function() {
390    $('a[href^="#"]').click(function(event) {
391        var target = $(this.hash);
392        if (target.length) {
393            event.preventDefault();
394            $('html, body').animate({
395                scrollTop: target.offset().top
396            }, 1000);
397        }
398    });
399});
400
401function MessageSub($id) {
402    var name = $("#" + $id + " .name").val();
403    if (name == "") {
404      alert("Please enter name!");
405      return false;
406    }
407    var emailreg =/([a-z0-9]*[-_.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[.][a-z]{2,3}([.][a-z]{2})?/i;
408    var email = $("#" + $id + " .email").val();
409    if (!emailreg.test(email)) {
410      alert("Please enter the correct email address!");
411      return false;
412    }
413    // var formData = $("#" + $id).serializeArray();
414    var _data = $("#" + $id).serializeArray();
415    
416    // 创建FormData
417    let fd = new window.FormData();
418    for (var i = 0; i < _data.length; i++) {
419        fd.append(_data[i].name, _data[i].value);
420    }
421    
422    if(files){
423        for (var i = 0; i < files.length; i++) {
424            fd.append('file[]', files[i]); // 注意 'file[]',确保传递的是数组
425        }
426    }
427    
428    
429    $(".loading-box").show();
430    $.ajax({
431      url: "/index.php?m=guestbook&f=index&v=contact",
432      type: "post",
433      contentType: false, 
434	  processData: false,
435      data: fd,
436      success: function (res) {
437        var data = JSON.parse(res);
438        if (data.code == 200) {
439          window.location.href = "/thanks/";
440        } else {
441          alert(data.msg);
442        }
443        $(".loading-box").hide();
444      }
445    });
446  }

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.