$(function() { var width = $(window).width(); var height = $(window).height(); if (width > 1024) { $('.section01 .swiper-slide').height(height); $('.section03 .s-list .swiper-slide').height(height); $('#fullpage').fullpage({ verticalcentered: true, anchors: ['home', 'new', 'apply', 'about', 'news', 'exhibit', 'footer'], keyboardscrolling: true, navigation: false, sectionselector: '.section', menu: "#menu", afterload: function(anchorlink, index) { if (index == 2 || index == 3 || index == 5) { $('.header').addclass('active'); if (index == 5) { $('.slide-box').addclass('active'); } else { $('.slide-box').removeclass('active'); } } else { $('.header').removeclass('active'); $('.slide-box').removeclass('active'); } }, onleave: function(index, nextindex, direction) { if (direction == 'down') { $('.header').fadeout(); } else { $('.header').fadein(); } } }); var s02 = new swiper('.section02 .swiper-container',{ watchoverflow: true, speed:1000, autoplay:false, slidesperview : 5, navigation: { nextel: '.section02 .swiper-button-next', prevel: '.section02 .swiper-button-prev', } }); }else{ var navdesktop = function () { $('.section02').addclass('active').siblings().removeclass('active'); addevent('scroll',function () { var scrollheight = document.documentelement.scrolltop||window.pageyoffset||document.body.scrolltop; var windowheight = $(window).height(); var temarr = ['0','1','2','3','4','5']; var state = false; for (var i=0;i<=temarr.length-1;i++){ (function (i) { var selscroll = $('#'+temarr[i]).offset().top; if(i==0 && selscroll - scrollheight > windowheight/2){ state = true; }else if(selscroll - scrollheight > 0 && selscroll - scrollheight < windowheight/2){ $('.section').each(function () { if($(this)[0].id == temarr[i]){ $(this).addclass('active'); } }); state = true; } })(i); if(state){ break; } } }); }; navdesktop(); } var s01_swiper = new swiper('.section01 .swiper-container', { speed: 2000, loop: true, // autoplay:false, autoplay: { delay: 7000, stoponlastslide: false, disableoninteraction: false, }, effect: 'fade', fadeeffect: { crossfade: true, }, navigation: { nextel: '.section01 .swiper-button-next', prevel: '.section01 .swiper-button-prev', }, pagination: { el: '.section01 .swiper-pagination', clickable: true, } }); $('.section02 .con .s-box').each(function(i,v){ var n=i+1; $(this).find('h3').text('0'+n+'.'); }); var s02_swiper = new swiper('.section03 .s-list .swiper-container', { speed: 2000, autoplay: false, effect: 'fade', fadeeffect: { crossfade: true, }, pagination: { el: '.section03 .s-list .swiper-pagination', clickable: true, }, on: { slidechangetransitionstart: function() { var index = this.activeindex; $('.section03 .s3-wrapper ul li').eq(index).addclass('active').siblings().removeclass('active'); }, }, }); var s02_wrapper = new swiper('.section03 .s3-wrapper .swiper-container',{ watchoverflow: true, speed:1000, autoplay:false, slidesperview : 6, navigation: { nextel: '.section03 .s3-wrapper .swiper-button-next', prevel: '.section03 .s3-wrapper .swiper-button-prev', } }); $('.section03 .s3-wrapper ul li').each(function(i,v){ var n=i+1; $(this).find('h3').text('0'+n+'.'); }); $('.section03 .s3-wrapper ul li:first-child').addclass('active'); $('.section03 .s3-wrapper ul li').click(function() { var index = $(this).index(); $(this).addclass('active').siblings().removeclass('active'); s02_swiper.slideto(index); }); var s05_swiper = new swiper('.section05 .swiper-container', { speed: 1000, autoplay: false, navigation: { nextel: '.section05 .swiper-button-next', prevel: '.section05 .swiper-button-prev', }, pagination: { el: '.section05 .swiper-pagination', clickable: true, } }); var s06_swiper = new swiper('.section06 .swiper-container', { speed: 1000, autoplay: false, slidesperview: 3, // loop:true, spacebetween: 40, navigation: { nextel: '.section06 .swiper-button-next', prevel: '.section06 .swiper-button-prev', }, pagination: { el: '.section06 .swiper-pagination', clickable: true, }, breakpoints: { 768: { //当屏幕宽度大于等于768 slidesperview: 1, spacebetween: 20 } }, on: { init: function() { if (width > 998) { $('.section06 .swiper-slide-next').next().next().addclass('hide'); } else { $('.section06 .swiper-slide-next').addclass('hide'); } }, slidechangetransitionstart: function() { $('.section06 .swiper-slide').removeclass('hide'); if (width > 998) { $('.section06 .swiper-slide-next').next().next().addclass('hide'); } else { $('.section06 .swiper-slide-next').addclass('hide'); } }, }, }); s06_swiper.slideto(0); settimeout(function () { $('.full-mask').addclass('active'); },700) settimeout(function () { $('.full-mask').hide(); },3200) })