var swiper = new swiper(".swiper_new", { pagination: { el: ".swiper-pagination-new", }, loop:true, autoplay:true, }); var swiper = new swiper(".swiper_new1", { pagination: { el: ".swiper-pagination-new1", }, loop:true, autoplay:true, }); var swiper2 = new swiper(".myswiper", { spacebetween: 10, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesperview: 4, }, 768: { //当屏幕宽度大于等于768 slidesperview: 4, }, 1280: { //当屏幕宽度大于等于1280 slidesperview: 9, } }, freemode: true, // watchslidesprogress: true, watchslidesvisibility: true, }); var swiper1 = new swiper('.business_swiper', { slidesperview: 3, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesperview: 1, }, 768: { //当屏幕宽度大于等于768 slidesperview: 1, }, 1280: { //当屏幕宽度大于等于1280 slidesperview: 3, } }, spacebetween: 30, centeredslides: true, loop: true, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, autoplay: true, thumbs: { swiper: swiper2, }, // autoscrolloffset: 1, }); var swiper3 = new swiper(".honor", { pagination: { el: ".swiper-pagination-honor", }, loop:true, autoplay:true, }); var swiper4 = new swiper(".employee", { pagination: { el: ".swiper-pagination-employee", }, loop:true, autoplay:true, }); var swiper5 = new swiper(".history", { pagination: { el: ".swiper-pagination-history", }, loop:true, autoplay:true, }); var swiper6 = new swiper(".page_news_swiper", { pagination: { el: ".page_news_pagination", }, loop:true, autoplay:true, }); var swiper7 = new swiper(".week_newspaper", { spacebetween: 10, slidesperview: 4, loop:true, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesperview: 1, direction: "horizontal", }, 768: { //当屏幕宽度大于等于768 slidesperview: 4, direction: "horizontal", }, 1200: { //当屏幕宽度大于等于1280 slidesperview: 4, direction: "vertical", } }, }); var swiper8 = new swiper(".join_swiper", { pagination: { el: ".join_pagination", bulletclass : 'my-bullet',//需设置.my-bullet样式 bulletactiveclass: 'my-bullet-active', }, loop:true, autoplay:true, }); scroll(".wrap1",".wrap1 ul",".wrap1 ul li"); //滚动 function scroll(name,name_ul,name_ul_li,) { var oul = $(name_ul); var oulhtml = oul.html(); oul.html(oulhtml + oulhtml) var timeid = null; var ali = $(name_ul_li); var aliwidth = ali.eq(0).width(); var alisize = ali.length; var ulwidth = aliwidth * alisize; oul.width(ulwidth); var speed = -2; function slider() { if (speed < 0) { if (oul.css('left') == -ulwidth / 2 + 'px') { oul.css('left', '0px'); } oul.css('left', '+=-2px'); } if (speed > 0) { if (oul.css('left') == '0px') { oul.css('left', -ulwidth / 2 + 'px'); } oul.css('left', '+=' + speed + 'px'); } } // setinterval()函数的作用是:每隔一段时间,执行该函数里的代码 timeid = setinterval(slider, 50); $(name).mouseover(function () { // clearinterval()函数的作用是用来清除定时器 clearinterval(timeid); }); $(name).mouseout(function () { timeid = setinterval(slider, 50); }); } $(function(){ $(".wechat_back_to_top .box div").hover(function (){ var index = $(this).index(); if(index == 0){ $(".wechat_back_to_top img").show(); } }) $(".wechat_back_to_top").mouseleave(function (){ $(".wechat_back_to_top img").hide(); }) $(".wechat_back_to_top .box div:eq(1)").click(function (){ $('body,html').animate({scrolltop:0},10); }) $(".wechat_back_to_top .box div:eq(1)").hover(function (){ $(".wechat_back_to_top img").hide(); }) //搜索 $(".search button").click(function (){ var keywords = $(".search input").val(); if(keywords == ""){ alert("请填写搜索关键字"); return false; } var href="?p=search_list&key="+keywords; window.open( href, "_blank"); }); //导航 var len = $("nav ul li").length; $("nav ul li").mouseover(function (){ var index = $(this).index(); $(".child_nav").hide(); $(".banner").css("margin-top","0px"); $(".child_nav .common").hide(); $(".show_"+index).show(10,function (){ $(".child_nav").show(); $(".banner").css("margin-top","-60px"); }); //计算二级导航距离 if(index === (len - 2)){ $(".child_nav .show_"+index).css("right",$(document).width() - ($(this).offset().left + $(this).width())+"px"); }else{ $(".child_nav .show_"+index).css("left",$(this).offset().left+"px"); } }) $("nav").mouseleave(function (){ $(".child_nav").hide(); $(".banner").css("margin-top","0px"); }) //手机导航 var windoww = $(window).width(); $('.sp_nav').click(function () { $('.sp_nav').toggleclass('sp_nav_se'); $('.sjj_nav').toggleclass('nav_show'); }); $('.sjj_nav ul li i').click(function () { $(this).parent().children('ul').slidetoggle().parent().siblings().children('ul').slideup(); $(this).toggleclass('sjj_nav_i_se'); $(this).parent().siblings().find('i').removeclass('sjj_nav_i_se'); }); $('.sp_nav_xjb').html(' '); //分页左侧 $(".left_nav li").click(function (){ $(this).find("dl").show(); }) $(".message div").click(function (){ $(".message div i").removeclass("text_white"); $(this).find("i").addclass("text_white"); }) $(".left_nav ul li .out").click(function (){ $(".left_nav ul li .out").removeclass('hover'); $(this).addclass('hover'); }) $(".left_nav dl dd").click(function (){ $(".right_context .title p").html("集团领导"); var index = $(this).index(); $(".leader_show").show(); $(".leader_hidden").hide(); $(".leader_"+index).show(); $(".left_nav dl dd").removeclass("dd_hover"); $(this).addclass("dd_hover"); $(".page_show").hide(); }) var wow = new wow({ boxclass: 'wow', animateclass: 'animated', offset: 0, mobile: true, live: true }); wow.init(); })