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
iOS 8.1 Mobile Auto Scrolling Off #799
Comments
Could you please confirm it happens the same with this example I've just made? Click on |
Yes it happens whenever I click on false and try to scroll. If I click back On Monday, October 27, 2014, alvarotrigo notifications@github.com wrote:
Best, |
I don't have iOS 8.1 yet in my Phone, but I'll try to take a look at it whenever I can. |
Thanks for responding so quickly! I don't know how to video record my iPhone screen at the moment, but will submit a video as soon as I figure it out. In the meantime, it seems that the culprit is in the setAutoScrolling function (line 117) in jquery.fullPage.js: $('html, body').scrollTop(element.position().top); My understanding is the the reason for the this line of code is to restore the user to the top of the active section where they were right before setAutoScrolling(false) was called. This makes sense to me. But for some reason in iOS 8.1, it seems that if you call setAutoScrolling(false) once, then it will continue to be called every so often while you are scrolling, thereby making your screen jump around while you scroll. I haven't figured out why this is happening yet. I've temporarily commented out that line, which resolves my issue for iOS 8.1. I will keep you posted in case I find a solution. |
Are you using the latest version of fullPage.js? (and of the CSS file?) (2.4.3) In case you aren't, please download the latest one and try it again. In case you are. Try going back to the previous version ( 2.4.2 for the JS file, and 2.1.9 for the CSS file). Then let me know if you keep having the problem. |
Any update with this issue? Did you solve it? |
Ok, I detected the problem. It is happening because the address bar in the top changes its size when scrolling up or down and the resize event is fired, causing the plugin to try to readjust and fit the sections in the screen. (as you can see in the demo page by resizing the window) It seems iOS 8 was not acting in the same way, it was probably not firing the resize event. I'll try to think about how to deal with it... |
Meanwhile I would suggest you to destroy the plugin with |
I've stumbled upon the same issue just today and have fixed it by disabling the vertical resize event for mobile devices. Here's the part I tweaked:
What I do here is check if the width changed on resize and if it didn't then it means a vertical resize happened (the address bar height changed). 1024px width is the limit of my choice to let desktops have the default behaviour. This is a quick fix and probably needs looking into/refining. |
I'm not quite sure if that would work in other device mobile OS such as Android, Windows Phone... That'd would need a bit more of testing. |
Tested in Android browser on HTC One X and a Samsung tablet, Safari on iPad and iPhone 4. I guess this Stack question is relevant here: |
@malydok right. It seems the values get updated after the In any case, I see you are doing some funny things in there, such as using the value of 1024: if(width > 1024 || width !== newWidth) { I think the solution is more simple. Just prevent calling the |
@malydok I'm seeing that the value of It might be because of the lack of this meta tag value as pointed out here.
|
@alvarotrigo That seems to be the case - viewport meta on my website matches the one you quoted. On the other hand |
I would like to find a solution which doesn't require to modify the HTML markup with any meta tag, as many people will not include it. |
This viewport meta is the most common one on responsive websites and in frameworks (h5bp, foundation, bootstrap, etc.) so most people already have it even if they don't really pay attention to it. I understand your concerns though and will try to help you look for a solution in my spare time. |
I've noticed the It doesn't sound like the perfect solution, as this might change in a future for other OS or an update of the browser and it sounds a bit weird only the |
That's actually what I did, although differently - by checking the width of the viewport. If the width didn't change on resize then obviously height did. Checking the size of resize is something I didn't include because it requires coming up with a magic number for the "not too big" part and it needs some testing. And still you have to detect the viewport height somehow. Does it work without |
The thing is that the |
Alrighty! Sounds good then. |
Is there any solution for this bug yet? The fix by @malydok didn't work for me. And I'm not too JS-smart to figure it out by myself. I have two slides and the the normal text. And I can't scroll to it at all. It just stuck at the second slide and keeps scrolling back to it. The bug is only in iOS Safari and Android. Everything is fine in iOS Chrome. |
@ffiona nop, we are thinking yet how to deal with it. Are you using |
@alvarotrigo I'm using |
@ffiona right, ok. I'll let you know when we find a proper way to deal with this bug. |
@alvarotrigo Thanks! |
@ffiona Is your website's viewport meta set as mentioned above? |
@malydok My viewport is the following: <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> |
@ffiona Could you try my code with exactly:
If this fails to work then I'm truly stumped. |
@malydok I tried, but unfortunately with no success. Scroll down is okay, but scroll up is almost impossible in my case. |
Steps to reproduce:
I have been stepping through the JS trying to determine what causes the section to scroll to the top on resize but it is eluding me. Destroying the object will cause problems with navigation so I don't want to do that, I simply want to prevent the scroll(jump) to the top of the section on resize. Can anyone point me to that method? Maybe it's not a simple answer? Thanks in advance, if I find something I will share it asap. |
If you read all the topic you will see I already figured out what's the cause of it:
|
- Fixed problem when `scrollBar: true` on mobile devices #855
Works for me. |
@malydok have you tested it in android? |
Works as expected - nothing was broken on my devices. |
Cool, then I'll close the topic if there's no objections. |
Tested it in andoroid and in ios, everything works. Thank you @alvarotrigo ! |
Tags: iOS, height, fix, problemSometimes when I use fullpage.js on iOS devices there is problem with height adjust (height of section is sometimes caluculated 10 times bigger than it is). My solution for this is to use this function: function getWindowHeight(){
return window.innerHeight ? window.innerHeight : $(window).height();
} inside afterRender and afterResize event like that ...
afterRender: function(){
$(".section").height(getWindowHeight());
},
afterResize: function(){
$(".section").height(getWindowHeight());
}
... and add CSS style
This solves problem with random section height on iPads and iPhones. I suggest use this solution to retrieve height on jquery.fullPage.js:462(v 2.6.9) |
Hello Alvaro.
|
@rohanchambers I'm not able to reproduce it in the scrollBar demo. |
Hi Alvaro,
I can’t replicate the bug on the scrollbar demo. However the issue occurs when responsiveWidth: 600
If you could have a look at this link and try and scroll up it just jumps straight to the top.
Many thanks for your support
Rohan
… On 14 Feb 2017, at 11:39, Álvaro ***@***.***> wrote:
@rohanchambers <https://github.com/rohanchambers> I'm not able to reproduce it in the scrollBar demo <http://alvarotrigo.com/fullPage/examples/scrollBar.html>.
Please add a link or a video of the issue ideally.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#799 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABq7t1EDQ0Gq8356mitYC206PstddZzLks5rcYR8gaJpZM4CzKoE>.
|
@rohanchambers you'll have to provide an isolated reproduction with no external CSS or JS so I can check it to make sure the problem is in fullPage.js and not in your side. |
Sorry to get back so late. I did an isolated version like you said and the issue didn't occur. I narrowed it down and the culprit was using the skrollr plugin when using fullpage. Just in case anyone runs in to the same problem, on resize() I was using the skrollr.init().destroy() function to remove skrollr below the width of 768 and if it was a mobile. However by doing this it caused the issue in question of jumping to the top of the window on mobile when swiping up. Issue code Solved with |
Hi, great plugin, thanks for all your work on it.
I've noticed that ever since I've upgraded to iOS 8.1, there are still remnants of auto scrolling on the actual iPhone device when scrolling through the page. For instance, try the following steps:
You should notice that the page jumps around as you scroll, when you really should expect the page to scroll smoothly.
I'm going to investigate this in the source code, but I was wondering if you can look to and if you had any ideas off the top of your head.
Thanks!
The text was updated successfully, but these errors were encountered: