PageSourceSearch

https://www.donghefastener.com/template/en/js/main.js

js donghefastener.com collected 2026-10-04 04:51:08 UTC 16,591 bytes, 684 lines download raw bytes

1/*!
2 * jQuery Cookie Plugin v1.4.1
3 * https://github.com/carhartl/jquery-cookie
4 *
5 * Copyright 2013 Klaus Hartl
6 * Released under the MIT license
7 */
8(function (factory) {
9    if (typeof define === 'function' && define.amd) {
10        // AMD
11        define(['jquery'], factory);
12    } else if (typeof exports === 'object') {
13        // CommonJS
14        factory(require('jquery'));
15    } else {
16        // Browser globals
17        factory(jQuery);
18    }
19}(function ($) {
20
21    var pluses = /\+/g;
22
23    function encode(s) {
24        return config.raw ? s : encodeURIComponent(s);
25    }
26
27    function decode(s) {
28        return config.raw ? s : decodeURIComponent(s);
29    }
30
31    function stringifyCookieValue(value) {
32        return encode(config.json ? JSON.stringify(value) : String(value));
33    }
34
35    function parseCookieValue(s) {
36        if (s.indexOf('"') === 0) {
37            // This is a quoted cookie as according to RFC2068, unescape...
38            s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
39        }
40
41        try {
42            // Replace server-side written pluses with spaces.
43            // If we can't decode the cookie, ignore it, it's unusable.
44            // If we can't parse the cookie, ignore it, it's unusable.
45            s = decodeURIComponent(s.replace(pluses, ' '));
46            return config.json ? JSON.parse(s) : s;
47        } catch (e) {
48        }
49    }
50
51    function read(s, converter) {
52        var value = config.raw ? s : parseCookieValue(s);
53        return $.isFunction(converter) ? converter(value) : value;
54    }
55
56    var config = $.cookie = function (key, value, options) {
57
58        // Write
59
60        if (value !== undefined && !$.isFunction(value)) {
61            options = $.extend({}, config.defaults, options);
62
63            if (typeof options.expires === 'number') {
64                var days = options.expires, t = options.expires = new Date();
65                t.setTime(+t + days * 864e+5);
66            }
67
68            return (document.cookie = [
69                encode(key), '=', stringifyCookieValue(value),
70                options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
71                options.path ? '; path=' + options.path : '',
72                options.domain ? '; domain=' + options.domain : '',
73                options.secure ? '; secure' : ''
74            ].join(''));
75        }
76
77        // Read
78
79        var result = key ? undefined : {};
80
81        // To prevent the for loop in the first place assign an empty array
82        // in case there are no cookies at all. Also prevents odd result when
83        // calling $.cookie().
84        var cookies = document.cookie ? document.cookie.split('; ') : [];
85
86        for (var i = 0, l = cookies.length; i < l; i++) {
87            var parts = cookies[i].split('=');
88            var name = decode(parts.shift());
89            var cookie = parts.join('=');
90
91            if (key && key === name) {
92                // If second argument (value) is a function it's a converter...
93                result = read(cookie, value);
94                break;
95            }
96
97            // Prevent storing a cookie that we couldn't decode.
98            if (!key && (cookie = read(cookie)) !== undefined) {
99                result[name] = cookie;
100            }
101        }
102
103        return result;
104    };
105
106    config.defaults = {};
107
108    $.removeCookie = function (key, options) {
109        if ($.cookie(key) === undefined) {
110            return false;
111        }
112
113        // Must not alter options, thus extending a fresh object...
114        $.cookie(key, '', $.extend({}, options, {expires: -1}));
115        return !$.cookie(key);
116    };
117
118}));
119
120
121
122;$(function(){
123     //*************mobile-header*************//
124
125     $(document).ajaxSuccess(function(event, jqXHR, settings) {
126        if (jqXHR.responseJSON && jqXHR.responseJSON.status === 200) {
127            location.href = '/success/';
128        }
129    });
130
131    $( '.menubtn' ).on('click', function(e) {
132
133        e.stopPropagation();
134
135        $(this).toggleClass('active');
136
137        $(".navigateli >li").removeClass('on');
138
139        $(".menudowns").hide();
140
141        if($(this).hasClass('active')){
142
143            $(".navigate").animate({'left':0},400);
144
145            $('.sideLayer').fadeIn(200);
146
147        }else{
148
149            $(".navigate").animate({'left':'-100%'},400);
150
151            $('.sideLayer').hide();
152
153        }
154
155        $('.navigateli .fa').removeClass('fa-chevron-up').addClass('fa-chevron-down');
156
157    });
158
159    $(".navigateli >li >a").on("click", function (e) {
160
161        var $navMobile=$(".navigate"),
162
163            $navA=$navMobile.find(".navigateli >li >a"),
164
165            $mSubnav=$navMobile.find(".menudowns");
166
167        var hjcur = $(this);
168
169        var hjDD = $(this).parents("li");
170
171        if (hjDD.find(".menudowns").size() > 0) {
172
173            if (hjDD.hasClass("on")) {
174
175                $navMobile.slideUp();
176
177                hjDD.find(".menudowns").stop(false, false).slideUp();
178
179                hjDD.removeClass("on");
180
181                $navMobile.slideUp();
182
183            } else {
184
185                $navA.parents('li').removeClass("on");
186
187                $mSubnav.stop(false, false).slideUp();
188
189                hjDD.find(".menudowns").stop(false, false).slideDown();
190
191                hjDD.addClass("on");
192
193                e.preventDefault();
194
195            }
196
197        }
198
199    });
200
201    $(".navigateli >li").filter(function(){
202
203        var subMenu = $(this).find('.menudowns');
204
205        if(subMenu.length){
206
207            var arrDown = $(this).find('.fa');
208
209            arrDown.show();
210
211            $(this).click(function(){
212
213                arrDown.removeClass('fa-chevron-down').addClass('fa-chevron-up');
214
215            });
216
217        }
218
219    });
220
221    $('#inner-head .mb-lan').click(function(){
222
223        $('#inner-head .mb-lanList').slideToggle(400);
224
225    });
226
227
228    $('.sideLayer').click(function(){
229		$(".menubtn").toggleClass('active');
230     $(".navigate").animate({'left':'-100%'},400);
231     $(this).hide();
232    });
233
234
235
236    $(document).click( function(e) {
237
238        $('#lanSelBox, .more_lang').removeClass('active');
239
240    });
241
242
243
244    $('#lanSelBox .current_lang').click(function(e){
245
246        e.stopPropagation();
247
248        $(this).parent().toggleClass('active');
249
250
251
252        setTimeout(function(){
253
254            $('.more_lang').toggleClass('active');
255
256        }, 5);
257
258    });
259
260
261
262    $('.mb-lan').click(function () {
263
264        $('.mb-lanList').slideToggle(400);
265
266    });
267
268
269    $('.mlztx').click(function(){
270		    $('.layer-form').fadeIn(200);
271		});
272		$('.layer-form .btn-hide-contact100 .fa-close').click(function(){
273		    $('.layer-form').fadeOut(200);
274		});
275		$('.layer-form .wpcf7-form').addClass('contact100-form');
276
277 if (document.getElementById('ewm')){
278        new QRCode(document.getElementById("ewm"), $("#ewm").attr('data-href') ? $("#ewm").attr('data-href'):window.location.href);
279    }
280
281
282    //wow.js扩展
283    $('.animate-father').filter(function(){
284        var sChil = $(this).attr('data-child'),
285            sEffect = $(this).attr('data-effect'),
286            sDelay = Number($(this).attr('data-delay')),
287            initDelay = 0;
288        $(this).find(sChil).addClass('wow').addClass(sEffect);
289        $(this).find(sChil).filter(function(){
290            initDelay+=sDelay;
291            $(this).attr('data-wow-delay',initDelay+'s');
292        });
293    });
294
295    new WOW().init();
296
297    $('.side-top a').filter(function () {
298        if ($(this).html() == $('.bread-crumbs span').html()) {
299            $(this).addClass('active');
300        }
301    });
302
303    $('.proFaq .faqBox').filter(function(){
304        var oBtn = $(this).find('.faq-tit').find('.icon'),
305            oAbst = $(this).find('.abst');
306        oBtn.click(function(){
307            $(this).toggleClass('active');
308            oAbst.slideToggle(400);
309        });
310    });
311
312
313    var bigLi = $('#header');
314    $(window).scroll(function() {
315        var sT = $(document).scrollTop();
316        if(sT > 120) {
317            bigLi.addClass('h-header');
318        }
319        else{
320            bigLi.removeClass('h-header');
321        }
322    });
323    
324    
325    $(".product-page .product-1 .right .content2>table tr").filter(function(){
326        $(this).children('td').attr({'style':'width:'+ (100/$(this).children('td').length) + '% !important'})
327    })
328    $(".product-page .product-1 .right .content2>table p").filter(function(){
329        if ($(this).html() === '&nbsp;' || $(this).html() === ' ') {
330            $(this).remove()
331        }
332    })
333    $(".prodet-page .prodet-2 .opsition>div").click(function(){
334        $(this).addClass('active').siblings().removeClass('active');
335        $(".prodet-page .prodet-2 .content div."+$(this).attr('data-id')).show().siblings().hide();
336    })
337    if ($(document).scrollTop() > 150) {
338        $("#header").addClass('active')
339    }else {
340        $("#header").removeClass('active')
341    }
342    $(window).scroll(function () {
343        if ($(document).scrollTop() > 150) {
344            $("#header").addClass('active')
345        }else {
346            $("#header").removeClass('active')
347        }
348    })
349$('.about-2 ul').slick({
350        autoplay: true,
351        pauseOnHover: false,
352        speed: 1500,
353        autoplaySpeed: 5000,
354        dots:true,
355        slidesToShow:4,
356        slidesToScroll:4,
357        responsive:[{
358            breakpoint:1000,
359            settings:{
360                slidesToShow:3,
361                slidesToScroll:3
362            }
363        },{
364            breakpoint:700,
365            settings:{
366                slidesToShow:2,
367                slidesToScroll:2,
368                arrows:false,
369                dots:false
370            }
371        },{
372            breakpoint:500,
373            settings:{
374                slidesToShow:1,
375                slidesToScroll:1,
376                arrows:false,
377                dots:false
378            }
379        }]
380    });
381
382    $('.about-3 .year ul').slick({
383        autoplay: true,
384        pauseOnHover: false,
385        speed: 1000,
386        autoplaySpeed: 3000,
387        slidesToShow:7,
388        centerMode:true,
389        centerPadding:'0',
390        asNavFor:'.about-3 .content ul',
391        responsive:[{
392            breakpoint:1000,
393            settings:{
394                slidesToShow:5,
395            }
396        },{
397            breakpoint:700,
398            settings:{
399                slidesToShow:3,
400                arrows:false,
401                dots:false
402            }
403        }]
404    });
405
406    $('.about-3 .content ul').slick({
407        autoplay: true,
408        pauseOnHover: false,
409        speed: 1000,
410        autoplaySpeed: 3000,
411        arrows:false,
412        asNavFor:'.about-3 .year ul'
413    });
414
415    $('.about-4 ul').slick({
416        autoplay: true,
417        pauseOnHover: false,
418        speed: 1500,
419        autoplaySpeed: 5000,
420        dots:true,
421        slidesToShow:4,
422        slidesToScroll:4,
423        responsive:[{
424            breakpoint:1200,
425            settings:{
426                slidesToShow:3,
427                slidesToScroll:3
428            }
429        },{
430            breakpoint:1000,
431            settings:{
432                slidesToShow:2,
433                slidesToScroll:2,
434                arrows:false,
435                dots:false
436            }
437        },{
438            breakpoint:500,
439            settings:{
440                slidesToShow:1,
441                slidesToScroll:1,
442                arrows:false,
443                dots:false
444            }
445        }]
446    });
447
448    $('.newdet-2 ul').slick({
449        autoplay: true,
450        pauseOnHover: false,
451        speed: 1500,
452        autoplaySpeed: 5000,
453        dots:true,
454        slidesToShow:4,
455        slidesToScroll:4,
456        responsive:[{
457            breakpoint:1200,
458            settings:{
459                slidesToShow:3,
460                slidesToScroll:3
461            }
462        },{
463            breakpoint:700,
464            settings:{
465                slidesToShow:2,
466                slidesToScroll:2,
467                arrows:false,
468                dots:false
469            }
470        },{
471            breakpoint:500,
472            settings:{
473                slidesToShow:1,
474                slidesToScroll:1,
475                arrows:false,
476                dots:false
477            }
478        }]
479    });
480
481    $('.pro-det-img ul').slick({
482        autoplay: true,
483        pauseOnHover: false,
484        speed: 1500,
485        autoplaySpeed: 5000,
486        arrows:false,
487        dots:true,
488        slidesToShow:4,
489        slidesToScroll:4,
490        responsive:[{
491            breakpoint:1200,
492            settings:{
493                slidesToShow:3,
494                slidesToScroll:3
495            }
496        },{
497            breakpoint:700,
498            settings:{
499                slidesToShow:2,
500                slidesToScroll:2,
501                dots:false
502            }
503        },{
504            breakpoint:500,
505            settings:{
506                slidesToShow:1,
507                slidesToScroll:1,
508                dots:false
509            }
510        }]
511    });
512
513    $('.prodet-3 ul').slick({
514        autoplay: true,
515        pauseOnHover: false,
516        speed: 1500,
517        autoplaySpeed: 5000,
518        dots:true,
519        slidesToShow:4,
520        slidesToScroll:4,
521        responsive:[{
522            breakpoint:1200,
523            settings:{
524                slidesToShow:3,
525                slidesToScroll:3
526            }
527        },{
528            breakpoint:700,
529            settings:{
530                slidesToShow:2,
531                slidesToScroll:2,
532                arrows:false,
533                dots:false
534            }
535        },{
536            breakpoint:500,
537            settings:{
538                slidesToShow:1,
539                slidesToScroll:1,
540                arrows:false,
541                dots:false
542            }
543        }]
544    });
545
546
547    // $.plugin.BG_parallax2($(".inner-banner"));
548    if ($(".news-page").length) {
549        $(".news-page .news-1 ul li").filter(function () {
550            if ($(this).children('a').attr('href') == window.location.href) {
551                $(this).addClass('active')
552            }
553        })
554    }
555
556    if ($(".product-page").length) {
557        $(".product-page .product-1 .left ul li").filter(function () {
558            if ($(this).children('a').attr('href') == window.location.href) {
559                $(this).addClass('active')
560            }
561        })
562    }
563
564
565    var honour = new Swiper('#honour', {
566    speed: 1000,
567    slidesPerView: 4,
568    spaceBetween: 20,
569    autoplay: true,
570    breakpoints: {
571        992: {
572            slidesPerView: 2
573        },
574        576: {
575            slidesPerView: 1
576        }
577    },
578    navigation: {
579        nextEl: '#honour-r',
580        prevEl: '#honour-l',
581    }
582})
583
584
585var honour = new Swiper('#factory', {
586    speed: 1000,
587    slidesPerView: 3,
588    spaceBetween: 20,
589    autoplay: true,
590    breakpoints: {
591        992: {
592            slidesPerView: 2
593        },
594        576: {
595            slidesPerView: 1
596        }
597    },
598    navigation: {
599        nextEl: '#factory-r',
600        prevEl: '#factory-l',
601    }
602});
603
604
605    if ($("#index-body .i-advantage").length){
606        $.plugin.NUMBER_plus($("#index-body .i-advantage .grid-box"));
607    }
608
609
610    if($('#seo_news').length){
611		const $news = $('#seo_news ul').slick({
612		    autoplay: true,
613			infinite: false,
614		    pauseOnHover: false,
615		    speed: 1500,
616		    autoplaySpeed: 5000,
617		    slidesToShow:3,
618			slidesToScroll:1,
619		    touchThreshold:100,
620		    centerMode:false,
621		    centerPadding:'0',
622			arrows:false,
623			dots:false,
624			responsive:[
625				{
626					breakpoint: 1000,
627					settings:{
628						slidesToShow:2,
629					}
630				},
631				{
632					breakpoint: 500,
633					settings:{
634						slidesToShow:1,
635					}
636				}
637			]
638		});
639	}
640
641});
642
643
644//SEO优化弹窗
645$(document).ready(function () {
646var SeoLayerCss = document.createElement("link");
647SeoLayerCss.rel = "stylesheet";
648SeoLayerCss.type = "text/css";
649SeoLayerCss.href = "/static/js/layer/skin/default/layer.css";
650$('body').append(SeoLayerCss);
651
652var SeoLayerJs = document.createElement('script');
653SeoLayerJs.src = '/static/js/layer/layer.js';
654$('body').append(SeoLayerJs);
655
656$("#FormSeo .inquery").click(function () {
657layer.load(0, {shade: 0.1, shadeClose: false})
658$.ajax({
659type: 'post',
660url: '/Api/contact/submit/uid/1.html',
661data: $("#FormSeo").serialize(),
662dataType: 'json',
663success: function (data) {
664layer.closeAll();
665if (data.status == 200) {
666layer.msg(data.result, {icon: 1, time: 4000});
667} else {
668layer.msg(data.result, {icon: 2, time: 4000})
669}
670}
671})
672})
673
674$('.right_nav_list .pop_btn').click(function () {
675$('#seo_form_cont').fadeIn();
676$('#pups_shadow').fadeIn();
677})
678
679$('#seo_form_cont i.close').click(function () {
680$('#seo_form_cont').fadeOut();
681$('#pups_shadow').fadeOut();
682})
683})
684//结束

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.