I'm trying to get the scrollTop() value while scrolling a website on the iPad/iPhone.
$(window).scroll(function(){
console.log($(window).scrollTop());
});
I'm using this code for normal desktop browsers. On Safari with the Mac the console shows every pixel while scrolling. But on the iPad, I only get the value when the scrolling stops.
How can I get every scrollTop value while scrolling even on the iPad?
Have you tried the following?
$(document).on( 'scroll', function(){
var currentPosition = $(window).scrollTop();
console.log(currentPosition);
});
This limitation changed in iOS 8
This continues to log $(window).scrollTop() after touchend while the inertia/bounce effect is running:
$(document).on( 'scroll', function(){
console.log($(window).scrollTop());});
tested on iPad 9.2, iPhone 9.3.4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With