PageSourceSearch

http://csbmkj.com/js/common.js?v=20181101112547

js csbmkj.com collected 2026-10-05 22:46:32 UTC 13,039 bytes, 375 lines download raw bytes

1$(function () {
2    wowInt();
3    findTel();
4    phoneTargetSelf();
5
6    $(window).resize();
7    pc_nav();
8
9    // JavaScript Document
10    $(document).ready(function () {
11        $(window).scroll(function(){
12            if($(this).scrollTop()>0){
13                $('body').addClass('scrollHeader');
14            }else{
15                $('body').removeClass('scrollHeader'); 
16            }
17        });
18        $(document).on('click','.nav_phone_btn,.nav_phone_tit .button',function(){
19            $('.nav_phone_con>ul>li').removeClass('on');
20            $('.nav_phone_btn').toggleClass('visible_nav');
21            $('body').toggleClass('body_nav_phone');
22        });
23
24        $(document).on('click','.nav_phone_con>ul>li',function(){
25            $(this).addClass('on');
26        });
27        $(document).on('click','.nav_phone_con>ul>li ul>li:first-child',function(e){
28            $('.nav_phone_con>ul>li').removeClass('on');
29            e.stopPropagation();
30        });
31    });
32    //end
33
34    // 搜索
35   $(".search").click(function (e) {
36        e.preventDefault();
37        e.stopPropagation();
38        if ($(".search_wrap").hasClass("on")) {
39            $(".search_wrap,.search").removeClass("on");
40        } else {
41            $(".search_wrap,.search").addClass("on");
42        }
43
44    })
45    $(".search_wrap").click(function (e) {
46        e.preventDefault();
47        e.stopPropagation();
48
49    })
50
51    $(document).click(function(){           
52        $(".search_wrap,.header_search").removeClass("on");
53    })
54    // 搜索
55
56    //--------------视频
57        //$(".index_video").height($(".index_video").width()*0.34375); 
58        $(".index_video").addClass('pause');
59        $(".index_video").find("video").trigger("pause");
60        $(document).on("click", ".index_video", function (){
61            var this_v = $(this).find("video");
62            if ($(this).hasClass('pause')) {
63              this_v.trigger("play");
64              $(this).removeClass('pause');
65              $(this).addClass('play');
66              $(this).find("em").hide();
67              $(this).find(".bg_layer").hide();
68              }
69              else {
70              this_v.trigger("pause");
71              $(this).removeClass('play');
72              $(this).addClass('pause');
73              $(this).find("em").show();
74              $(this).find(".bg_layer").show();
75            }
76        })  
77    //end
78
79
80    /*企业荣誉左侧悬浮.................................................start*/
81    // if($(".about_history .part_1 .leftbox").size()>0)  {//判断是否具有左侧导航
82    //     $(window).scroll(function(){
83    //         var fixnavtop=$(".about_history .part_1 .rightbox").offset().top // 与跟随板块同高的板块到顶部的距离
84    //         var fixnavHeight=$(".about_history .part_1 .leftbox").height() // 左侧导航高度
85    //         var footerHeight=($(".footer").outerHeight(true)+parseInt($('.main').css('margin-bottom'))) // 底部板块高度
86    //         var documentHeight=$(document).height() // 文本高度
87    //         var headerHeight=0 // 跟随头部的高度
88    //         if ($(window).scrollTop()>(fixnavtop-headerHeight)) { // 开始跟随的距离
89    //             if ($(window).scrollTop()>(documentHeight-footerHeight-fixnavHeight)) { // 底部停止跟随的距离
90    //                 $(".about_history .part_1 .leftbox").css({'position':'absolute','bottom':'0','top':'auto'})
91    //             }
92    //             else{
93    //                 $(".about_history .part_1 .leftbox").css({'position':'fixed','top':headerHeight,'bottom':'auto'})
94    //             }
95    //         }
96    //         else{
97    //             $(".about_history .part_1 .leftbox").attr('style','') // 停止跟随
98    //         }
99    //
100    //     })
101    // }
102/*企业荣誉左侧悬浮.................................................end*/
103
104/*企业荣誉左侧轮播....................................................start*/
105    var swiper = new Swiper('.about_history .part_1 .swiper-container', {
106        slidesPerView: 11,
107        centeredSlides: true,
108        mousewheelControl: true,
109        direction :'vertical',
110        initialSlide :0,
111        resistanceRatio : 0.3,
112        followFinger : true,
113        slideToClickedSlide: true,
114        breakpoints: { 
115            1023: {
116              slidesPerView: 7,
117              initialSlide :4,
118            }
119        },
120        onTouchMove: function (swiper) {
121            jQuery.getScript("../js/ratio-img.js");
122            his_position();
123            hisAjax($(".swiper-slide-active a").attr("href"));
124        },
125        onTouchEnd: function (swiper) {
126            jQuery.getScript("../js/ratio-img.js");
127            his_position();
128            hisAjax($(".swiper-slide-active a").attr("href"));
129        },
130        onSlideChangeStart: function (swiper) {
131            jQuery.getScript("../js/ratio-img.js");
132            his_position();
133            hisAjax($(".swiper-slide-active a").attr("href"));
134        },
135        onInit: function(swiper){
136            jQuery.getScript("../js/ratio-img.js");
137            his_position();
138            hisAjax($(".swiper-slide-active a").attr("href"));
139
140        }
141    });
142    function his_position() {
143        $(".swiper-slide").removeClass("prev_nth2Mode next_nth2Mode prev_nth3Mode next_nth3Mode prev_nth4Mode next_nth4Mode prev_nth5Mode next_nth5Mode prev_nth6Mode next_nth6Mode");
144        $(".swiper-slide-active").prev().addClass("prev_nth2Mode");
145        $(".swiper-slide-active").next().addClass("next_nth2Mode");
146        $(".swiper-slide-active").prev().prev().addClass("prev_nth3Mode");
147        $(".swiper-slide-active").next().next().addClass("next_nth3Mode");
148        $(".swiper-slide-active").prev().prev().prev().addClass("prev_nth4Mode");
149        $(".swiper-slide-active").next().next().next().addClass("next_nth4Mode");
150        $(".swiper-slide-active").prev().prev().prev().prev().addClass("prev_nth5Mode");
151        $(".swiper-slide-active").next().next().next().next().addClass("next_nth5Mode");
152        $(".swiper-slide-active").prev().prev().prev().prev().prev().addClass("prev_nth6Mode");
153        $(".swiper-slide-active").next().next().next().next().next().addClass("next_nth6Mode");
154    }
155    function hisAjax(url) {
156        if (url.indexOf('?') == -1) {
157            url = url + '?tm=' + Math.random() + '';
158        } else {
159            url = url + '&tm=' + Math.random() + '';
160        }
161        $.ajax({
162            url: url,
163            type: "GET",
164            success: function (msg) {
165                $('#content').html($(msg).find('#content').html())
166            }
167        });
168    }
169    $(".about_history .part_1 .swiper-slide a").click(function(event){
170        event.preventDefault(); 
171    });
172/*企业荣誉左侧轮播....................................................end*/
173
174        
175
176})
177
178
179
180function pc_nav(){
181    $('.header .nav>ul>li .navlist').fadeOut(0);
182    $('.header .nav>ul>li').each(function(){
183        if ($(this).find('li').length>-2) {
184            $(this).mouseover(function() {
185                $(this).find('.navlist').stop(true,true).delay(200).slideDown(300)
186                $(this).siblings().find('.navlist').slideUp(300)
187            });
188        }
189
190    });
191    $('.header').mouseleave(function(){
192        $('.header .navlist').slideUp(300)
193    })
194}
195
196function wowInt(){
197    if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){
198        var wow = new WOW({
199            boxClass: 'wow',
200            animateClass: 'animated',
201            offset: -100,
202            mobile: false,
203            live: true
204        });
205        wow.init();
206    };
207}
208
209
210/*手机端链接改为本窗口打开*/
211function phoneTargetSelf(context){  
212  if ($(window).width()<1024) {
213    if(context==undefined){
214      context=$(document);
215    }
216    $('a',context).each(function(){
217      var target=$(this);
218      var link=target.attr('target');
219      target.attr('target','_self');
220    })
221  }
222}
223
224
225/*电话链接取消默认事件并添加样式*/
226function findTel(context){
227  if ($(window).width()>1024) {
228    var condition = /^tel\:([0-9\-]+)|tel\:\+([0-9\-]+)$/;
229    if(context==undefined){
230      context=$(document);
231    }
232    $('a',context).each(function(index, el) {
233      var target=$(this);
234      var href=target.attr('href');
235      if (condition.test(href)) {
236        target.addClass('tel_link');
237        target.on('click',function(event){
238          event.preventDefault();
239        })
240      }
241    });
242  }
243}
244
245//--------------数字变化
246$(window).scroll(function(){
247    digitInt('#in-count-1',2,$('.index_block01 .txt ul li').hasClass('animated'));
248    digitInt('#in-count-2',2,$('.index_block01 .txt ul li:eq(1)').hasClass('animated'));
249    digitInt('#in-count-3',2,$('.index_block01 .txt ul li:eq(2)').hasClass('animated'));
250})
251
252
253function digitInt(targetId,speed,trigger){
254    if ($(targetId).length>0) {
255        var count_add=0;
256        var addTimer=null;
257        var count=$(targetId);
258        if ($(window).width()>1023) {
259            if (trigger==null) {
260                trigger=true;
261            }
262            if (trigger==true) {
263                if (!count.get(0).getAttribute("digitTriggle")) {
264                    addTimer = setInterval(function () {
265                        count_add += Math.floor(Math.random() * speed);
266                        if (count_add >= Number(count.attr("rel"))) {
267                            count.text(addCommas(Number(count.attr("rel"))));
268                            clearInterval(addTimer);
269                        } else {
270                            count.text(addCommas(count_add));
271                        }
272                    }, 10)
273                }
274                count.get(0).setAttribute('digitTriggle',true);              
275            }
276        }
277        else{
278            count.text(Number(count.attr("rel")));
279        }
280    }
281}
282function addCommas(nStr) {
283    nStr += '';
284    var x = nStr.split('.');
285    var x1 = x[0];
286    var x2 = x.length > 1 ? '.' + x[1] : '';
287    var rgx = /(\d+)(\d{3})/;
288    // while (rgx.test(x1)) {
289    //     x1 = x1.replace(rgx, '$1' + ',' + '$2');
290    // }
291    return x1 + x2;
292}
293//end
294
295
296/*内容页文章字体切换*/
297function fontChange(changeFont,articleClass){
298    var article=$(articleClass);
299    if (changeFont=='big') {
300        article.css('font-size','18px')
301    }
302    if (changeFont=='medium') {
303        article.css('font-size','16px')
304    }
305    if (changeFont=='small') {
306        article.css('font-size','14px')
307    }
308}
309
310// 打印
311function printBind(){
312    $('a#print-but').on('click',function(){
313        $('body').addClass('print_preview');
314        setTimeout(function(){
315            window.print();
316            $('body').removeClass('print_preview');
317        },200)
318    })
319}
320
321
322window.onload = function(){
323    setTimeout(function(){
324        $(window).scroll();
325    },300)
326}
327
328
329
330$(function () {
331//--------------模拟下拉
332 $(document).on("click", ".select-box dt a", function (e) {
333        e.preventDefault();
334        e.stopPropagation();
335        if ($(this).parents(".disabled").hasClass("disabled"))
336        {
337            return false;
338        }
339
340        $(".select-body-box,.selectmask").remove();
341        var el = $(this).parents(".select-box");
342        el.addClass("open");
343        var ht = el.find("dd").html(),
344            oftop = el.offset().top + el.height(),
345            ofleft = el.offset().left,
346            ofwidth = el.width();
347       
348        if ($(window).width() < 767) {
349            $("body").append("<div class='select-body-box'>" + ht + "</div><a href='javascript:;' class='selectmask'></a>");           
350            oftop = ($(window).height() - $(".select-body-box").height()) / 2;
351            $(".select-body-box").css({ top: oftop });
352        } else {
353            $("body").append("<div class='select-body-box' style='top:" + oftop + "px; left:" + ofleft + "px;
353 width:" + ofwidth + "px;' >" + ht + "</div><a href='javascript:;' class='selectmask'></a>");
354        }
355    })
356    $(document).on("click", ".select-body-box a", function (e) {
357        var inde = $(this).index();
358        $(this).addClass("on").siblings().removeClass("on");        
359        var el = $(".select-box.open");
360        el.next(".select-hidden").val($(this).attr("data-val"))
361        el.find("dt a b").text($(this).text());
362        el.find("dd a b").eq(inde).addClass("on").siblings().removeClass("on");
363        setTimeout(function () {//其他方法判断open的延迟;
364            el.removeClass("open");
365        },1)
366        $(".select-body-box,.selectmask").remove();
367    })
368    $(document).click(function () {
369        $(".select-box.open").removeClass("open");
370        $(".select-body-box,.selectmask").remove();
371    })
372//end
373
374})
375

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.