4

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

leonheess
  • 16,068
  • 14
  • 77
  • 112
dva
  • 41
  • 1
  • Vote on [this proposal](https://meta.stackoverflow.com/questions/354583/disentangle-the-yarn) to ease the tag confusion. – leonheess Feb 10 '20 at 12:24

0 Answers0