function tab(item, list, event) { $(item).on(event, function () { $(this).addclass('active').siblings().removeclass('active'); $(list).eq($(this).index()).addclass('block').siblings().removeclass('block'); }) } tab('.tab1','.wrap1','click') tab('.tab2','.wrap2','click') $('.navs').click(function () { $(this).addclass('nav_active').siblings().removeclass('nav_active') $('.nav_dropdown').eq($(this).index() - 1).show().siblings('.nav_dropdown').hide() }) $(".navs").hover(function () { $('.nav_dropdown').eq($(this).index() - 1).show().siblings('.nav_dropdown').hide() }); $('.nav_dropdown').hover(function () { $(this).show() }, function () { $(this).hide(); }) var now = new date(); var year = now.getfullyear(); //得到年份 var month = now.getmonth() + 1;//得到月份 var date = now.getdate();//得到日期 var hour = now.gethours(); var minute = now.getminutes() var second = now.getseconds() var time = ""; var timehms = "" time = year + "-" + month + "-" + date timehms = year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second $('._timer').text(time) // $('.source_timer').text(timehms) // var myswiper3 = new swiper('.business_right_banner1', { // loop: true, // pagination: { // el: '.paging-business-right1', // }, // navigation: { // nextel: '.business_right_banner1 .swiper-button-next', // prevel: '.business_right_banner1 .swiper-button-prev', // }, // init: true, // observer: true, // observeparents: true, // on: { // init: function () { // var total = this.slides.length - 2; // $('.total1').text('0' + total); // this.emit('transitionend'); // }, // transitionend: function () { // var index = this.realindex + 1; // $(".active1").text("0" + index); // } // } // }); // var myswiper4 = new swiper('.business_right_banner2', { // loop: true, // pagination: { // el: '.paging-business-right2', // }, // observer: true, // observeparents: true, // navigation: { // nextel: '.business_right_banner2 .business-next2', // prevel: '.business_right_banner2 .business-prev2', // }, // on: { // init: function (swiper) { // var total = this.slides.length - 2; // $('.total2').text('0' + total); // this.emit('transitionend'); // }, // transitionend: function () { // var index = this.realindex + 1; // $(".active2").text("0" + index); // } // } // }); // var myswiper5 = new swiper('.business_right_banner3', { // loop: true, // pagination: { // el: '.paging-business-right3', // }, // navigation: { // nextel: '.business_right_banner3 .swiper-button-next', // prevel: '.business_right_banner3 .swiper-button-prev', // }, // observer: true, // observeparents: true, // on: { // init: function () { // var total = this.slides.length - 2; // $('.total3').text('0' + total); // this.emit('transitionend'); // }, // transitionend: function () { // var index = this.realindex + 1; // $(".active3").text("0" + index); // } // } // }); // var myswiper6 = new swiper('.business_right_banner4', { // loop: true, // pagination: { // el: '.paging-business-right4', // }, // navigation: { // nextel: '.business_right_banner4 .swiper-button-next', // prevel: '.business_right_banner4 .swiper-button-prev', // }, // observer: true, // observeparents: true, // on: { // init: function () { // var total = this.slides.length - 2; // $('.total4').text('0' + total); // this.emit('transitionend'); // }, // transitionend: function () { // var index = this.realindex + 1; // $(".active4").text("0" + index); // } // } // }); // var myswiper7 = new swiper('.business_right_banner5', { // loop: true, // pagination: { // el: '.paging-business-right5', // }, // navigation: { // nextel: '.business_right_banner5 .swiper-button-next', // prevel: '.business_right_banner5 .swiper-button-prev', // }, // observer: true, // observeparents: true, // on: { // init: function () { // var total = this.slides.length - 2; // $('.total5').text('0' + total); // this.emit('transitionend'); // }, // transitionend: function () { // var index = this.realindex + 1; // $(".active5").text("0" + index); // } // } // });