With Fullpage.js, Can Y-position Inside Sections Be Reported During Scrolloverflow Scrolling? (using Iscroll-probe)
Solution 1:
It is indeed possible. Although the iScroll library has some bugs that were solved for its use in fullpage.js with the scrolloverflow.js fork. I would suggest you to do those changes yourself in the iScroll Probe.
Regarding how to get the scrolling possition, just take a look at the source example you provided to know which iscroll events to use.
Then, just take the iscroll instance of the section that can be extracted with:
$('.fp-section.active').find('.fp-scrollable').data('iscrollInstance');
Or from the active slide:
$('.fp-section.active').find('.fp-slide.active').find('.fp-scrollable').data('iscrollInstance');
And use the iScroll option probeType:3 as detailed in their docs. To do so extend the default scrolloverflow options with the scrollOverflowOptions param.
And mixing all together...
$('#fullpage').fullpage({
sectionsColor: ['yellow', 'orange', '#C0C0C0', '#ADD8E6'],
scrollOverflow:true,
scrollOverflowOptions: {
probeType: 3
},
afterLoad: function(anchorLink, index){
var iscroll = $('.fp-section.active').find('.fp-scrollable').data('iscrollInstance');
if(iscroll && typeof iscroll !== undefined){
iscroll.on('scroll', getScroll);
}
}
});
functiongetScroll(){
console.log(this.y);
$('#position').text(this.y);
}
Solution 2:
I believe it is impossible, because both plugins will try to work with the same 'element', at the same time, and in ways different. So, it'll conflict each others, of course. I'm sorry, but try another way. :/
Post a Comment for "With Fullpage.js, Can Y-position Inside Sections Be Reported During Scrolloverflow Scrolling? (using Iscroll-probe)"