Skip to content

Instantly share code, notes, and snippets.

@thetwopct
Created March 13, 2019 06:01
Show Gist options
  • Save thetwopct/6cdd31e956298918ba714c3255c1eb61 to your computer and use it in GitHub Desktop.
Save thetwopct/6cdd31e956298918ba714c3255c1eb61 to your computer and use it in GitHub Desktop.
Hide Up/Down Navigation Arrows on First and Last slides on fullpage.js
new fullpage("#fullpage", {
navigation: false,
controlArrows: false,
afterLoad: function(origin, destination, direction) {
var loadedSection = this;
if (destination.isFirst) {
$("#moveUp").hide();
} else {
$("#moveUp").fadeIn();
}
},
onLeave: function(origin, destination, direction) {
if (destination.isLast) {
$("#moveDown").fadeOut();
} else {
$("#moveDown").fadeIn();
}
}
});
$(document).on("click", "#moveUp", function() {
fullpage_api.moveSectionUp();
});
$(document).on("click", "#moveDown", function() {
fullpage_api.moveSectionDown();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment