Skip to content

Instantly share code, notes, and snippets.

@nhylated
Last active June 21, 2018 14:54
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhylated/6a1a360a0ad321546abc to your computer and use it in GitHub Desktop.
Save nhylated/6a1a360a0ad321546abc to your computer and use it in GitHub Desktop.
fullPage.js fade effect for slides
var SCROLLING_SPEED = 700;
// fullPage.js settings for fading-in slides insead of scrolling them
$('#fullpage').fullpage({
scrollingSpeed: SCROLLING_SPEED,
// Hide the slides container before the next slide loads
onSlideLeave: function(anchorLink, index, slideIndex, direction) {
$.fn.fullpage.setScrollingSpeed(0);
$('.fp-section').find('.fp-slidesContainer').hide();
},
// Display the slides container by fading it in after the next slide has been loaded.
afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex) {
$('.fp-section').find('.fp-slidesContainer').fadeIn(700);
$.fn.fullpage.setScrollingSpeed(SCROLLING_SPEED);
},
});
@levipadre
Copy link

Hi,
I hope you can help me a bit. I'm using the same plugin as you were and have a same problem. I need fade transition between slides. This solution is working pretty well, but for me the middle slide doesn't fade somehow: https://jsfiddle.net/b1r310t3/7/

Also do you think how can I do the same with the sections as well?

I know it's not your plugin, but maybe you can help.
Thanks!

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