fullPage.js
fullPage.js copied to clipboard
Feature Q: Is it possible to set Fullpage options in data attrs?
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.
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! 👍
I came up with something similar, (not as simple as yours though!) but just wanted to check. Thanks for the response.