fullPage.js icon indicating copy to clipboard operation
fullPage.js copied to clipboard

Feature Q: Is it possible to set Fullpage options in data attrs?

Open JayBox325 opened this issue 5 years ago • 2 comments

Description

I have two pages on a project, one that is predominantly horizontal (with the horizontal scroll extension) and another which is vertical. They use all the same settings except I need navigation: true on the vertical one and false on the horizontal scroller.

Do I need to have two separate Full page instances or can I conditionally set navigation to true with a data tag or in the options?

Link to isolated reproduction with no external CSS / JS

No reproduction required IMO.

JayBox325 avatar Aug 05 '20 13:08 JayBox325

Do I need to have two separate Full page instances or can I conditionally set navigation to true with a data tag or in the options?

You could do something like the following:


var hasNavigation = [YOUR LOGIC HERE];

new fullpage('#fullpage', {
     scrollHorizontally: true,
     navigation: hasNavigation ? true : false,
     scrollBar: false
}

At the moment it is not possible to initialise fullPage.js through html data attributes. I'll mark it as a possible enhancement tho! 👍

alvarotrigo avatar Aug 05 '20 16:08 alvarotrigo

I came up with something similar, (not as simple as yours though!) but just wanted to check. Thanks for the response.

JayBox325 avatar Aug 06 '20 14:08 JayBox325