开发者社区> 问答> 正文

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

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

展开
收起
小旋风柴进 2016-03-26 11:50:02 2424 0
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);
                }
            }
        });
    });
    2019-07-17 19:16:00
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
JavaScript异步编程 立即下载
Delivering Javascript to World 立即下载
编程语言如何演化-以JS的private为例 立即下载