Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Spellhammer
Last active March 26, 2023 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spellhammer/5347655a8de1b4202e7b48cd07b5f56a to your computer and use it in GitHub Desktop.
Save Spellhammer/5347655a8de1b4202e7b48cd07b5f56a to your computer and use it in GitHub Desktop.
FullPageJSJavaScript
jQuery(document).ready( function() {
if( window.angular ) return;
new fullpage('#fullpage', {
//options here
autoScrolling:true,
scrollHorizontally: true,
anchors: ['firstPage', 'secondPage', 'thirdPage'],
lockAnchors: false,
menu: '#div_block-28-6',
afterLoad: function(anchorLink, index) {
jQuery('.fullpage-anchor').removeClass('anchor-active');
jQuery('a[href="#' + index["anchor"] + '"]').addClass('anchor-active');
}
});
//methods
fullpage_api.setAllowScrolling(true);
});
@jarnopeeters
Copy link

Can you please update this code so it's still compatible with WordPress 5.6 (jQuery issue)?

@Uwishvajith
Copy link

Uwishvajith commented Aug 14, 2021

jQuery issue. fullpage.js not found on line 2

@Spellhammer
Copy link
Author

I've followed this tutorial again to see if it's fundamentally broken, but it appears to still be working fine despite an error that I only see in the builder itself.

Two things:

  1. If the error is only in the builder, add this line just inside the jQuery(document).ready function, before the new fullpage line:
    if( window.angular ) return;
    That will prevent the code from running in the builder and causing errors.
  2. It looks like fullPage.js now requires a license key, so it's possible they're throwing an error if the licenseKey option isn't present.

@azegas
Copy link

azegas commented Sep 23, 2021

I just have followed the tutorial and everything works like a charm!

@azegas
Copy link

azegas commented Sep 23, 2021

Any idea how I can make the footer from the template "main" show as well? This is an example - https://www.pixelhouse.lt/. I can not apply this, because oxygen doesnt allow spaces in class names? https://codepen.io/alvarotrigo/pen/BKjRYm

Or. for example, I can create a unique footer section in the front page, but i don't want it to take up the whole screen. Can I use other class than "section" to make it work?

@safafeer
Copy link

Hello, the code is correct, except for line 21. If you put it, the code will not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment