Fullpage.js卡扩展-仅适用于第一张幻灯片

时间:2020-01-02 20:41:23

标签: jquery fullpage.js

我正在使用具有扩展卡的fullpage.js。有什么方法可以仅将卡片效果应用于第一张幻灯片,然后将常规fullpage.js应用于其他幻灯片?

$('#fullpage').fullpage({
    cards: true,
    cardsOptions: {
        perspective: 100,
        fadeContent: true,
        fadeBackground: true
    },

    onLeave: function(origin){
        if( origin.index > 0 ){
            // cards: false; <- Does not work...
        }
    },
});

1 个答案:

答案 0 :(得分:0)

您可以了解有关Cards extension on the wiki page链接的the fullpage.js documentation的可用方法的信息

当检测到不是第一部分时,可以在afterLoad回调中使用以下方法:

fullpage_api.cards.destroy();

然后您可以使用以下方法再次对其进行初始化:

fullpage_api.cards.init();

点击左下角的“打开”和“关闭”按钮,您可以在Cards 3d demo page上看到此设置。