-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added iscroll-probe files #2531
base: master
Are you sure you want to change the base?
Conversation
Added iscroll to use probeType option and onScroll event.
Thanks for it! Just a little problem with it: As detailed in the dos:
There's a reason why the file In order to add the probe version those bugs would have to get solved in that versions too. |
Thanks for the advice. I just fix that bug like in the issue you linked here and I tested on IE 11. If all it's ok, maybe we should change the name of the files to "scrolloverflow-probe". |
Added the files again. I deleted them accidentally.
Thanks for that I'll review it at some point. |
i still cannot track the offset.
did i miss something ? |
@squalvj check my answer here. |
For those looking at this in 2018, scrolloverflow.js seems to have moved forward and probe was never merged from these old open pull requests trying to get probe into scrolloverflow.js. You basically have to redo the merge yourself with the latest scrolloverflow.js. In my experience just now, these pull request modified files will not work with the latest fullpage.js. You can diff one of these modified for probe iscroll-probe.js or scrolloverflow.js pull request versions with the scrolloverflow.js version of that time or just search for probeType for the new code you'll have to copy and paste into the current scrolloverflow.js. The final filename must be scrolloverflow.min.js for it to work with the current fullpage.js. Then for usage, @alvarotrigo posted his example which is still relevant. Here are what the changes currently look like: |
Hi, (DISCLAIMER: I am a fairly competent programmer who is just getting started with web design) I was just wondering as to the current status of this feature? I am currently using the latest build of fullpage.js, I have read through the example given by @alvarotrigo and for the most part copied the example. I have also manually merged the missing code as detailed by @andrespr. However, it dose not seem to pickup the 'scroll' action. I'm not sure if this is because it is not being fired correctly or its not being picked up. I changed the 'scroll' to 'scrollStart' and it worked correctly. I have included a copy of my current settings in the page here. I would very much appreciate any advice or help. |
I haven't reviewed it yet. |
Thank you for the quick reply, is there anything that you could point me towards in the mean time. I'm coming up short for guidance. |
My answer here: |
Hi, I'm trying to reproduce this, but variable iscroll is undefined. Is there some kind of new approach to this in the newest version of fullpage? |
@niC00L some things have changes, such as
Also, if you use the old callback, make sure to use the fullpage.js option |
@alvarotrigo Thank you for a quick reply. I am able to get iscroll instance now, but the scroll event doesn't work. Other events work fine. Any suggestions? Did I forgot something? |
As you can read on the stackoverflow answer, you'll need to use the probe version of iScroll and modify it a bit to fix a few bugs I fixed when forking it. |
Or, you can try to use the file provided by @vekvoid, which apparently got those fixed: |
Hi Guys, I have just tried doing this. I added iscroll-probe.js from this link here: This has been added before my scrolloverflow.min.js I have added on the code as follows:
I do not seem to be getting any response in the console or the #position div Here is my codepen: https://codepen.io/AmanSahota/pen/MqpJzx Can anyone help? |
Anybody has got this to work? codepen or anywhere? i'm facing the same issue. im able to get the fp_iscrollInstance data however the on scroll call back doesn't triggers. BTW I'm using the latest version 3.0.3. |
@alvarotrigo I tried the iscroll-probe.js from the library and https://github.com/vekvoid/fullPage.js/blob/15c3006bcedd633aac3e76b5ce5058f06caba704/vendors/iscroll-probe.js I've added the scrolloverflowoptions (probeType 3) and the v2 compatibility. I'm getting the iscrollinstance. using: But the scroll event won't fire. console.log(iscroll); //returns instance
Any ideas on how to fix this? |
I got a pretty hacky solution for my specific problem, below is some of my code which sould demonstrate it. In order to make it work you need to first set the following options: scrollOverflow: true,
scrollOverflowOptions: {
probeType: 3,
useTransition: false,
} As per the original iScroll doc, it should work only with transitions disabled, but i couldn't get the _translate: function (x, y) {
if ( this.options.useTransform ) {
/* REPLACE START: _translate */
this.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;
/* REPLACE END: _translate */
} else {
x = Math.round(x);
y = Math.round(y);
this.scrollerStyle.left = x + 'px';
this.scrollerStyle.top = y + 'px';
}
this.x = x;
this.y = y;
/* START ADDED */
if ( this.options.probeType == 3 ) {
this._execEvent('scroll');
}
/* END ADDED */
if ( this.indicators ) {
for ( var i = this.indicators.length; i--; ) {
this.indicators[i].updatePosition();
}
} window.fp_scrolloverflow.iscrollHandler.iScrollInstances[0].on('scroll', function () {
$('.header').css({
'top' : -this.y
});
}); You may need to work on timing, i still need to find the correct event when to add the scroll event, because the |
Thanks for the info @cwildfoerster ! 👍 |
Added iscroll-probe.js and iscroll-probe.min.js to use probeType option and onScroll event.