PageSourceSearch

https://www.tjufe.edu.cn/template_files/1/js/base.js

js tjufe.edu.cn collected 2026-10-02 05:48:18 UTC 14,636 bytes, 478 lines download raw bytes

1/**
2 * Created by Administrator on 2019/12/18.
3 */
4/*移动端导航事件*/
5
6$(function () {
7    /*全局动画效果*/
8    var wow = new WOW({
9        boxClass: 'wow',
10        animateClass: 'animated',
11        offset: 0,
12        mobile: false,
13        live: true
14    });
15    wow.init();
16
17
18    /*数字增长*/
19    $('.counter').countUp();
20
21
22
23    /*滚动条样式加载*/
24    $(".scroll_ele").mCustomScrollbar();
25    /*点击回到顶部*/
26    $(".go_top").click(function () {
27        $("html,body").animate({
28            scrollTop: 0
29        }, 1500);
30    })
31
32    /*全屏展开菜单*/
33    $('#open_full_menu').click(function () {
34        $('.full_menu').addClass('open');
35    })
36    $("#close_full_menu").click(function () {
37        $('.full_menu').removeClass('open');
38    })
39
40
41
42    /*锚点顺滑*/
43    $('.left_menu_ul li a').click(function() {
44        $('html,body').animate({scrollTop: ($($(this).attr('href')).offset().top )}, 1000);
45    });
46
47    /*首页banner轮播*/
48    var banner_swiper = new Swiper('.banner_swiper', {
49        effect : 'fade',
50        loop: true,
51        loopAdditionalSlides : 2,
52        observer: true,//修改swiper自己或子元素时,自动初始化swiper
53        observeParents: true,//修改swiper的父元素时,自动初始化swiper
54        autoplay: {
55         delay: 8000,
56         stopOnLastSlide: false,
57         disableOnInteraction: false,
58         },
59        speed: 2000,
60        pagination: {
61            el: '.swiper-pagination-banner',
62            clickable: true
63        },
64        on: {
65            init: function(){
66                console.log(this.slides.length - 6);
67                console.log(this.realIndex);
68            },
69            slideChangeTransitionStart: function () {
70                console.log(this.slides.length - 6);
71                $('.banner_new .num .total').html(this.slides.length - 6);
72                $('.banner_new .num .active').html(this.realIndex + 1);
73            },
74
75        },
76    });
77    $(".banner_new_con .more_icon").on("click", function (event) {
78        banner_swiper.slideNext();
79        event.stopPropagation();    //  阻止事件冒泡
80
81    })
82
83
84
85    /*首页-banner新闻联动*/
86    var banner_new_container = new Swiper('.banner_new_container', {
87        effect : 'fade',
88        loop: true,
89        observer: true,//修改swiper自己或子元素时,自动初始化swiper.
90        observeParents: true,//修改swiper的父元素时,自动初始化swiper
91        autoplay: {
92            delay: 8000,
93            stopOnLastSlide: false,
94            disableOnInteraction: false,
95        },
96
97        speed: 2000,
98        spaceBetween: 15,
99        navigation: {
100            nextEl: '.swiper-button-next-banner-new',
101        },
102        pagination: {
103            el: '.swiper-pagination-banner-new',
104            clickable: true
105        },
106     /*   controller: {
107            control: banner_swiper, //控制Swiper1
108        },*/
109    });
110 /*   if(!!banner_new_container.controller == true){
111        banner_swiper.controller.control = banner_new_container;//Swiper1控制Swiper2,需要在Swiper2初始化后
112        banner_new_container.controller.control = banner_swiper;//Swiper2控制Swiper1,需要在Swiper1初始化后
113    }*/
114
115    /*首页-第二屏左侧新闻轮播*/
116    var index_news_left_container = new Swiper('.index_news_left_container', {
117        effect : 'fade',
118        speed: 1000,
119        loop: true,
120        autoplay: {
121            delay: 3000,
122            stopOnLastSlide: false,
123            disableOnInteraction: false,
124        },
125        spaceBetween: 15,
126        pagination: {
127            el: '.swiper-pagination-news-left',
128            clickable: true,
129        }
130    });
131
132    /*首页- 学术讲座轮播图*/
133    var talk_container = new Swiper('.talk_container', {
134        loop: true,
135        speed: 1000,
136        slidesPerView: 2,
137        spaceBetween: 15,
138        centeredSlides: true,
139        slidesPerGroup : 1,
140        navigation: {
141            prevEl: '.swiper-button-prev-talk',
142            nextEl: '.swiper-button-next-talk',
143        },
144        breakpoints: {
145            1681: {  //当屏幕宽度大于等于1680
146                slidesPerView: 4,
147                spaceBetween: 50,
148                slidesPerGroup : 2
149            },
150            1367: {  //当屏幕宽度大于等于1366
151                slidesPerView: 4,
152                spaceBetween: 40,
153                slidesPerGroup : 2
154            },
155            901: {  //当屏幕宽度大于等于900
156                slidesPerView: 4,
157                spaceBetween: 30,
158                slidesPerGroup : 2
159            },
160        },
161    });
162
163
164    /*首页- 通知公告轮播图*/
165    var announcement_container = new Swiper('.announcement_container', {
166        loop: true,
167        speed: 1000,
168        slidesPerView: 1,
169        spaceBetween: 5,
170        slidesPerGroup : 1,
171        centeredSlides: true,
172        navigation: {
173            prevEl: '.swiper-button-prev-announcement',
174            nextEl: '.swiper-button-next-announcement',
175        },
176        breakpoints: {
177            1681: {  //当屏幕宽度大于等于1680
178                slidesPerView:3,
179                spaceBetween: 5
180            },
181            1367: {  //当屏幕宽度大于等于1366
182                slidesPerView: 3,
183                spaceBetween: 5
184            },
185            901: {  //当屏幕宽度大于等于900
186                slidesPerView: 3,
187                spaceBetween: 5
188            },
189        },
190    });
191
192
193
194
195    /*首页- 媒体天财轮播图*/
196    var Media_container = new Swiper('.Media_container', {
197        loop: true,
198        speed: 1000,
199        slidesPerView: 2,
200        spaceBetween: 15,
201        slidesPerGroup : 2,
202        navigation: {
203            prevEl: '.swiper-button-prev-Media',
204            nextEl: '.swiper-button-next-Media',
205        },
206        breakpoints: {
207            1681: {  //当屏幕宽度大于等于1680
208                slidesPerView: 4,
209                spaceBetween: 68
210            },
211            1367: {  //当屏幕宽度大于等于1366
212                slidesPerView: 4,
213                spaceBetween: 50
214            },
215            901: {  //当屏幕宽度大于等于900
216                slidesPerView: 4,
217                spaceBetween: 40
218            },
219        },
220    });
221
222
223
224    /*首页 招生信息 切换*/
225    $(".right_info_ul li").on("mouseover", function () {
226        $(this).addClass("on").siblings().removeClass('on');
227        var dataClass = $(this).attr("data-class");
228        $(".left_img_ul li").removeClass("active");
229        $("." + dataClass).addClass("active");
230    })
231
232
233    /*大学章程展开收起*/
234    $(".constitution1_list li:nth-of-type(1) .info").slideDown(500);
235    $(".constitution1_list li .title").on("click", function () {
236        $(this).parent('li').toggleClass("active");
237        $(this).next(".info").slideToggle(500);
238    })
239
240
241    /*天财新闻上方新闻切换*/
242    $(".news1_right_info .index_news_list li").on("mouseover", function () {
243        $(this).addClass("on").siblings().removeClass('on');
244        var dataClass = $(this).attr("data-class");
245        $(".news1_left_img .left_img_list li").removeClass("active");
246        $("." + dataClass).addClass("active");
247    })
248
249
250
251
252
253    /*天才时间-精彩生活图片轮播图*/
254    var time3_img_container = new Swiper('.time3_img_container', {
255        loop: true,
256        speed: 1000,
257        autoplay: {
258         delay: 3000,
259         stopOnLastSlide: false,
260         disableOnInteraction: true,
261         },
262        slidesPerView: "auto",
263        spaceBetween: 15,
264        navigation: {
265            prevEl: '.swiper-button-prev-time-img',
266            nextEl: '.swiper-button-next-time-img',
267        },
268        breakpoints: {
269            1681: {  //当屏幕宽度大于等于1680
270                spaceBetween: 50
271            },
272            1367: {  //当屏幕宽度大于等于1366
273                spaceBetween: 40
274            },
275            901: {  //当屏幕宽度大于等于900
276                spaceBetween: 30
277            },
278        },
279    });
280
281    /*侧边客服二维码*/
282    /*全屏展开菜单*/
283    $('.open_fix_img').click(function (e) {
284        if(e.preventDefault){
285            e.preventDefault();
286        }else{
287            window.event.returnValue == false;
288        }
289        $('.fix_img').addClass('open');
290    })
291    $("#close_fix_img").click(function () {
292        $('.fix_img').removeClass('open');
293    })
294
295    /*击水案例-案例导航轮播图*/
296    var case_nav_container = new Swiper('.case_nav_container', {
297        loop: true,
298        speed: 1000,
299        slidesPerView: 4,
300        spaceBetween: 20,
301        autoHeight: true, //高度随内容变化
302        navigation: {
303            prevEl: '.swiper-button-prev-nav',
304            nextEl: '.swiper-button-next-nav',
305        },
306        breakpoints: {
307            1681: {  //当屏幕宽度大于等于1680
308                slidesPerView: 6,
309                spaceBetween: 75
310            },
311            1367: {  //当屏幕宽度大于等于1366
312                slidesPerView: 6,
313                spaceBetween: 60
314            },
315            901: {  //当屏幕宽度大于等于900
316                slidesPerView: 6,
317                spaceBetween: 30
318            },
319        },
320    });
321
322    /*击水案例页面-相关案例轮播*/
323    var case_container = new Swiper('.case_container', {
324        loop: true,
325        speed: 1000,
326        /*autoplay:true,*/
327        slidesPerView: 2,//一行显示1个
328        spaceBetween: 15,
329        navigation: {
330            prevEl: '.swiper-button-prev-case',
331            nextEl: '.swiper-button-next-case',
332        },
333        breakpoints: {
334            1681: {  //当屏幕宽度大于等于1680
335                slidesPerView: 4,
336                spaceBetween: 40,
337            },
338            1367: {  //当屏幕宽度大于等于1366
339                slidesPerView: 4,
340                spaceBetween: 30,
341            },
342            901: {  //当屏幕宽度大于等于900
343                slidesPerView: 4,
344                spaceBetween: 25,
345            },
346        },
347    });
348    /*新闻资讯页面-相关新闻轮播*/
349    var relate_news_container = new Swiper('.relate_news_container', {
350        loop: true,
351        speed: 1000,
352        /*autoplay:true,*/
353        slidesPerView: 2,//一行显示1个
354        spaceBetween: 15,
355        navigation: {
356            prevEl: '.swiper-button-prev-relate-new',
357            nextEl: '.swiper-button-next-relate-new',
358        },
359        breakpoints: {
360            1681: {  //当屏幕宽度大于等于1680
361                slidesPerView: 3,
362                spaceBetween: 50,
363            },
364            1367: {  //当屏幕宽度大于等于1366
365                slidesPerView: 3,
366                spaceBetween: 40,
367            },
368            901: {  //当屏幕宽度大于等于900
369                slidesPerView: 3,
370                spaceBetween: 30,
371            },
372        },
373    });
374    /*新闻资讯页-左侧推荐新闻*/
375    var news_top_container = new Swiper('.news_top_container', {
376        effect : 'fade',
377        loop: true,
378        speed: 500,
379        autoplay:{
380            delay: 4000,
381        },
382        navigation: {
383            prevEl: '.swiper-button-prev-news-top',
384            nextEl: '.swiper-button-next-news-top',
385        },
386
387    });
388
389    /*分割线--------------------------------------------------*/
390
391    /*锚点顺滑*/
392    $('.left_menu_ul li a').click(function() {
393        $('html,body').animate({scrollTop: ($($(this).attr('href')).offset().top )}, 1000);
394    });
395
396})
397$(window).scroll(function(){   //开始监听滚动条
398    var top = $(document).scrollTop();  //滚动条距离顶部的高度
399    if(top > 40 ) {
400        $(".topnav").addClass("white");
401    }
402    if(top < 40 || top == 40){
403        $(".topnav").removeClass("white");
404    }
405
406})
407
408
409
410
411window.onload = function () {
412    if($(window).width() < 900){
413        $(".right_info_ul li a").prop('href','javascript:void(0);');
414        $(".news1_right_info .index_news_list li a").prop('href','javascript:void(0);');
415    }
416    /*多余文字点点点*/
417    $(".points").each(function(i){
418        var divH = $(this).height();
419        var $text = $(".text_con", $(this)).eq(0);
420        while ($text.outerHeight() > divH) {
421            $text.text($text.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, "..."));
422        };
423    });
424    /*获取padding*/
425    function getPadding(){
426        var windowWidth = $(window).width();
427        var wWidth = $(".w").width();
428        return (windowWidth - wWidth)/2;
429    }
430    var padding = getPadding();
431    $(".sec7_left .index_title").css("paddingLeft",padding+"px");
432    $(".time3_bot").css("paddingLeft",padding+"px");
433    $(".time2_left").css("paddingLeft",padding+"px");
434    $(".sec7_right").css("paddingRight",padding+"px");
435    $(".banner_new").css("paddingRight",padding+"px");
436    $(window).resize(function () {
437        let re_padding = getPadding();
438        //当浏览器大小变化时
439        $(".sec7_left .index_title").css("paddingLeft",re_padding+"px");
440        $(".time3_bot").css("paddingLeft",re_padding+"px");
441        $(".time2_left").css("paddingLeft",re_padding+"px");
442        $(".sec7_right").css("paddingRight",re_padding+"px");
443        $(".banner_new").css("paddingRight",re_padding+"px");
444
445
446        if($(window).width() < 900){
447            $(".right_info_ul li a").prop('href','javascript:void(0);');
448            $(".news1_right_info .index_news_list li a").prop('href','javascript:void(0);');
449        }
450    });
451
452
453
454    /*跳动的按钮*/
455    var bottom1 = 90; var bottom2 = 120;
456    if ($(window).width() < 900) {
457        bottom1 = 10;
458        bottom2 = 30;
459    }
460    var timer;
461    function shake() {
462        timer = setInterval(function () {
463            $('.down_icon').animate({ bottom: bottom1 }, 550);
464            setTimeout(function () {
465                $('.down_icon').animate({ bottom: bottom2 }, 550);
466            })
467        }, 650);
468    }
469    shake();
470    $('.down_icon').hover(function () {
471        clearInterval(timer);
472        $('.down_icon').stop().css({ bottom: bottom1 });
473    }, function () {
474        shake();
475    })
476
477}
478

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.