删除fullpage.js特定部分的动画

时间:2019-02-15 09:23:43

标签: jquery fullpage.js

在每个部分上滚动时,im动画不透明度0到1成功,但是现在的问题是我想删除最后一节中特定部分示例的animate(opacity),是否有任何想法要删除它?

("#fullpage").fullpage({
            anchors: ['slide1', 'slide2', 'slide3', 'slide4'],
            sectionsColor: ['#ffffff', '#ffffff', '#ffffff', '#ffffff'],
            navigation: true,
            navigationPosition: 'right',
            scrollingSpeed: 1000,
            onLeave: function(index, nextIndex, direction){
                    $('.section.fp-section.fp-table.active').animate({
                        opacity: 0,
                        transition: "opacity 0.4s ease-out",
                    }, 500 );

                    $('.section.fp-section.fp-table[data-anchor="slide'+nextIndex+'"]').animate({
                        opacity: 1,
                        transition: "opacity 0.4s ease-out",
                    }, 1000 );

                    // for specific last section ( i got added the opacity : 1,but it no works)

                    if(index == $("#fullpage .section").length){
                        alert('last div : going out');
                        $('.section.fp-section.fp-table').css('opacity',1);
                    }

                    if(nextIndex == $("#fullpage .section").length){
                        alert('last div : coming in');
                        $('.section.fp-section.fp-table.active').css('opacity',1);
                    }

                // }
            }
        });

0 个答案:

没有答案