I'm facing an issue while trying to incorporate multiple afterLoad and onLeave events in my fullpage.js
for different sections. It seems like only the last one I set up is functional. What could be causing this problem?
Interestingly, when I remove the last event, the first one works as expected. This indicates that I might be combining them incorrectly, causing one to override the other.
$('#fullpage').fullpage({
onLeave: function(index, nextIndex, direction) {
if (nextIndex == 3 || nextIndex == 1) {
$('.aboutme').hide("slide", {
direction: "left"
}, 200);
}
},
afterLoad: function(anchorLink, index) {
if (index == 2) {
$('.aboutme').show("slide", {
direction: "left"
}, 200);
}
},
onLeave: function(index, nextIndex, direction) {
if (nextIndex == 2) {
$('.titlea').hide("slide", {
direction: "right"
}, 200, function() {
$('.titleb').hide("slide", {
direction: "right"
}, 200);
});
}
},
afterLoad: function(anchorLink, index) {
if (index == 1) {
$('.titlea').show("slide", {
direction: "right"
}, 200, function() {
$('.titleb').show("slide", {
direction: "right"
}, 200);
});
}
}
});
Can you guide me on the correct approach to combine multiple onLeave
and afterLoad
methods effectively?