//banner $('.index_banner').slick({ autoplay: true, arrows: false, dots:false, infinite: true, speed: 500, autoplayspeed: 5000, pauseonhover: false, fade: true, responsive: [ { breakpoint: 992, settings: { dots: true } } ] }); $('.index_banner').init(function(slick){ $('.index_banner .item.slick-current').addclass('active').siblings().removeclass('active') }) $('.index_banner').on('afterchange',function(slick,currentslide){ $('.index_banner .item.slick-current').addclass('active').siblings().removeclass('active'); var _index = $('.index_banner').slick('slickcurrentslide') $('.section1 .number span').eq(_index).addclass('active').siblings().removeclass('active') }) $('.section1 .number span').click(function(){ var _index = $(this).index(); $('.index_banner').slick('slickgoto',_index); $(this).addclass("active").siblings().removeclass("active") }); $('.section1 .prev').click(function(){ $('.index_banner').slick('slickprev') }) $('.section1 .next').click(function(){ $('.index_banner').slick('slicknext'); }); //导航 //超过一定高度导航添加类名 var nav=$("header"); //得到导航对象 var win=$(window); //得到窗口对象 var sc=$(document);//得到document文档对象。 win.scroll(function(){ if(sc.scrolltop()>=100){ nav.addclass("on"); }else{ nav.removeclass("on"); } }) //移动端展开nav $('#navtoggle').on('click',function(){ $('.m_nav').addclass('open'); }) //关闭nav $('.m_nav .top .closed').on('click',function(){ $('.m_nav').removeclass('open'); }) //二级导航 移动端 $(".m_nav .ul li").click(function() { $(this).children("div.dropdown_menu").slidetoggle('slow') $(this).siblings('li').children('.dropdown_menu').slideup('slow'); }); //全屏滚动 $('#index_main').fullpage({ 'navigation': true, slidesnavigation: true, controlarrows: false, continuoushorizontal:true, scrollingspeed:1000, showactivetooltip :true, anchors: ['hero', 'one', 'two', 'three'], loophorizontal: true, afterload: function(anchorlink, index){ if(index == 1){ $('header').removeclass('on'); } if(index == 2){ $('header').addclass('on'); $('.section2 h3').addclass('animated fadeinup').css('animation-delay', '.1s'); } if(index == 3){ $('header').addclass('on'); $('.section3 h3').addclass('animated fadeinup').css('animation-delay', '.1s'); } if(index == 4){ $('header').addclass('on'); $('.section4 h3').addclass('animated fadeinup').css('animation-delay', '.1s'); } }, onleave: function(index, direction){ } })