jquery.fullpage.js中的哪个变量是等同于zepto.fullpage.js中的.cur

之前在移动端用zepto.fullpage.js实现全屏滚动效果,用jquery.fullpage.js中哪个变量可以获取当前屏的索引值呢?

阅读 4.1k
1 个回答
$(function(){
    $('#dowebok').fullpage({
        sectionsColor: ['#1bbc9b', '#4BBFC3', '#7BAABE', '#f90'],
        afterLoad: function(anchorLink, index){
            if(index == 2){
                $('.section2').find('p').delay(500).animate({
                    left: '0'
                }, 1500, 'easeOutExpo');
            }
            if(index == 3){
                $('.section3').find('p').delay(500).animate({
                    bottom: '0'
                }, 1500, 'easeOutExpo');
            }
            if(index == 4){
                $('.section4').find('p').fadeIn(2000);
            }
        },
        onLeave: function(index, direction){
            if(index == '2'){
                $('.section2').find('p').delay(500).animate({
                    left: '-120%'
                }, 1500, 'easeOutExpo');
            }
            if(index == '3'){
                $('.section3').find('p').delay(500).animate({
                    bottom: '-120%'
                }, 1500, 'easeOutExpo');
            }
            if(index == '4'){
                $('.section4').find('p').fadeOut(2000);
            }
        }
    });
});
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进