I am trying to import Fullpage.js in my Sage theme. I installed FullPageScroll with:
npm install fullpage.js
added the following code: scripts/main.js:
// import external dependencies
import 'jquery';
import 'fullpage.js/vendors/scrolloverflow.js';
import 'fullpage.js/dist/fullpage.js';
and: scripts/routes/home.js:
// Initializing it
$('#fullpage').fullpage({
//options here
autoScrolling: true,
//Navigation
navigation: true,
navigationPosition: 'left',
});
//methods
$.fn.fullpage.setAllowScrolling(true);
But still got this error (I followed the instruction documented in Sage book chapter 6.6):
Uncaught TypeError: fullpage is not a constructor