PageSourceSearch

http://www.easyux.net/res/cn/js/index.js

js easyux.net collected 2026-10-07 03:42:05 UTC 9,923 bytes, 344 lines download raw bytes

1$(function(){
2
3
4    //ie兼容filter,indexOf
5    if (!Array.prototype.filter)
6    {
7        Array.prototype.filter = function(fun /*, thisp */)
8        {
9            "use strict";
10
11            if (this === void 0 || this === null)
12                throw new TypeError();
13
14            var t = Object(this);
15            var len = t.length >>> 0;
16            if (typeof fun !== "function")
17                throw new TypeError();
18
19            var res = [];
20            var thisp = arguments[1];
21            for (var i = 0; i < len; i++)
22            {
23                if (i in t)
24                {
25                    var val = t[i]; // in case fun mutates this
26                    if (fun.call(thisp, val, i, t))
27                        res.push(val);
28                }
29            }
30
31            return res;
32        };
33    }
34    if (!Array.prototype.indexOf){
35        Array.prototype.indexOf = function(elt /*, from*/){
36            var len = this.length >>> 0;
37
38            var from = Number(arguments[1]) || 0;
39            from = (from < 0)
40                ? Math.ceil(from)
41                : Math.floor(from);
42            if (from < 0)
43                from += len;
44
45            for (; from < len; from++){
46                if (from in this && this[from] === elt)
47                    return from;
48            }
49            return -1;
50        };
51    }
52
53    //二维码弹出框
54    $('.bottom_nav .WeChat').click(function () {
55        $('.WeChatModel').show();
56    });
57    $('.WeChatModel .bg').click(function () {
58        $(this).parent().hide();
59    });
60
61    //PC导航
62    $(".nav>li").hover(function () {
63        $(this).find(".child_nav").stop(false,true).slideDown(0);
64        if($(this).find('.child_nav').length > 0){
65            $(this).addClass('on').siblings().removeClass('on');
66        }
67    },function () {
68        $(this).find(".child_nav").stop(false,true).slideUp(0);
69        $(this).removeClass('on');
70    });
71
72
73    //搜索
74    $('.hadSer_btn').click(function () {
75        $(".had_form").stop(false,true).slideToggle();
76    });
77    $(".form_close").click(function () {
78        $(this).parent().stop(false,true).slideUp();
79    });
80
81
82    //banner大图轮播
83    $(".banner").slick({
84        dots:true,//指示点
85        arrows:false,
86        infinite: false,
87        autoplay:true,
88        autoplaySpeed:5000,//自动播放间隔
89    });
90
91
92    //产品
93    $(".two_slider").slick({
94        dots:false,//指示点
95        arrows:true,
96        infinite: false,
97        responsive: [
98            {
99                breakpoint: 768,
100                settings: {
101                    dots:true,
102                    arrows:false,
103                }
104            }],
105    });
106
107    function twoSlider(){
108        return{
109            dots:false,//指示点
110            arrows:true,
111            infinite: false,
112        }
113    }
114
115    $('.two_contA .tab_list li').click(function () {
116        var tabIndex = $(this).index();
117        $(this).addClass('on').siblings().removeClass('on');
118        $('.two_contA .two_box .two_item').eq(tabIndex).addClass('on').siblings().removeClass('on');
119        $('.two_contB .two_listBox').eq(tabIndex).addClass('on').siblings().removeClass('on');
120
121        $(".two_contA .two_slider").slick('unslick');
122        $(".two_contA .two_slider").slick(twoSlider());
123    });
124
125
126    $('.three_cont .slider-for').slick({
127        slidesToShow:1,
128        slidesToScroll:1,
129        arrows:false,
130        fade:true,
131        infinite: false,
132        asNavFor:'.three_cont .slider-nav',
133    });
134    $('.three_cont .slider-nav').slick({
135        slidesToShow:4,
136        slideToScroll:1,
137        asNavFor:'.three_cont .slider-for',
138        dots:false,
139        arrows:true,
140        infinite: false,
141        focusOnSelect:true,
142        responsive: [
143            {
144                breakpoint: 768,
145                settings: {
146                    slidesToShow:2,
147                }
148            }],
149    });
150
151    //新闻
152    $(".four_lt .four_list").hover(function () {
153        $(this).addClass('on').siblings('.four_list').removeClass('on');
154    });
155    $('.four_slider').slick({
156        dots:true,
157        arrows:false,
158        infinite: false,
159        dotsClass: 'custom_paging',//指示点类名
160        customPaging: function (slider, i) { //只显示当前页和总页数 (即3/5)
161            return '<i>' + (i + 1) + '</i>' + '/' + slider.slideCount;
162        }
163    });
164    function fourSlider(){
165        return{
166            dots:true,
167            arrows:false,
168            infinite: false,
169            dotsClass: 'custom_paging',//指示点类名
170            customPaging: function (slider, i) { //只显示当前页和总页数 (即3/5)
171                return '<i>' + (i + 1) + '</i>' + '/' + slider.slideCount;
172            }
173        }
174    }
175    $('.fourTab_list').click(function () {
176        var tabIndex = $(this).index();
177        $(this).addClass('on').siblings().removeClass('on');
178        $('.four_box .four_item').eq(tabIndex).addClass('on').siblings().removeClass('on');
179
180        $(".four_item .four_slider").slick('unslick');
181        $(".four_item .four_slider").slick(fourSlider());
182    });
183
184
185
186
187    //手机导航
188    $(".menu").click('touchstart',function () {
189        $('.left_navBox').addClass('on');
190        $('.body').addClass('on');
191    });
192    $(".left_navBg").click('touchstart',function () {
193        $('.left_navBox').removeClass('on');
194        $('.body').removeClass('on');
195    });
196    $("ul.left_nav a").click(function (event) {
197        if ($(this).siblings("ul").length > 0) {
198            var a = $(this);
199            var thisname = a.attr('class');
200            if (thisname == null || thisname == 0) {
201                a.siblings("ul").slideDown(300);
202                a.parent().siblings().find('ul').slideUp(500).siblings("a").removeClass();
203                a.find('i').text('+');
204                var parent = a.parent().parents("ul").attr('class');
205                switch (parent) {
206                    case "left_nav":
207                        a.addClass("on");
208                        a.find('i').text('-').parents('li').siblings().find('i').text('+');
209                        break;
210                    case "left_navTwo":
211                        a.addClass("on");
212                        a.find('i').text('-').parents('li').siblings().find('i').text('+');
213                        break;
214                    case "left_navThree":
215                        a.addClass("on");
216                        break;
217                }
218            } else {
219                a.removeClass().siblings('ul').slideUp(300);
220                a.siblings('ul').find('a').removeClass().siblings('ul').slideUp(300);
221                a.find('i').text('+');
222                a.siblings('ul').find('i').text('+');
223            };
224            return false;
225        };
226    });
227    $("ul.left_nav i").each(function () {
228        if($(this).parent().siblings('ul').length > 0){
229            $(this).addClass('in');
230        }else{
231            $(this).removeClass("in");
232        }
233    });
234
235    //返回顶部
236    $(".scrollTop").click(function () {
237        $('body,html').animate({scrollTop:'0px'},500)
238    });
239
240    $(".foot_nav .wx").click(function () {
241        $('.wx_bg').show();
242        $('.wx_model').show();
243    });
244    $(".wx_bg").click(function () {
245        $(this).hide();
246        $('.wx_model').hide();
247    });
248
249
250    //内页导航
251    $("ul.det_nav a").click(function (event) {
252        if ($(this).siblings("ul").length > 0) {
253            var a = $(this);
254            var thisname = a.attr('class');
255            if (thisname == null || thisname == 0) {
256                a.siblings("ul").slideDown(300);
257                a.parent().siblings().find('ul').slideUp(500).siblings("a").removeClass();
258                a.find('i').text('+');
259                var parent = a.parent().parents("ul").attr('class');
260                switch (parent) {
261                    case "det_nav":
262                        a.addClass("on");
263                        a.find('i').text('-').parents('li').siblings().find('i').text('+');
264                        break;
265                    case "det_navTwo":
266                        a.addClass("on");
267                        a.find('i').text('-').parents('li').siblings().find('i').text('+');
268                        break;
269                }
270            } else {
271                a.removeClass().siblings('ul').slideUp(300);
272                a.siblings('ul').find('a').removeClass().siblings('ul').slideUp(300);
273                a.find('i').text('+');
274                a.siblings('ul').find('i').text('+');
275            };
276            return false;
277        };
278    });
279    $("ul.det_nav i").each(function () {
280        if($(this).parent().siblings('ul').length > 0){
281            $(this).addClass('in');
282        }else{
283            $(this).removeClass("in");
284        }
285    });
286
287    $(".classBtn").click(function () {
288        $(this).toggleClass('on');
289        $('.det_nav').stop(false,true).slideToggle();
290        if($(this).hasClass('on')){
291            $(this).find('i').text('-')
292        }else{
293            $(this).find('i').text('+')
294        }
295    });
296
297    //产品详情
298    $('.proD_slider .slider-for').slick({
299        slidesToShow:1,
300        slidesToScroll:1,
301        arrows:false,
302        fade:true,
303        infinite: false,
304        asNavFor:'.proD_slider .slider-nav',
305    });
306    $('.proD_slider .slider-nav').slick({
307        slidesToShow:4,
308        slideToScroll:1,
309        asNavFor:'.proD_slider .slider-for',
310        dots:false,
311        arrows:true,
312        infinite: false,
313        focusOnSelect:true,
314    });
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335});
336
337
338
339
340
341
342
343
344

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.