简体   繁体   中英

scroll event not fired for apple-mobile-web-app-capable during deceleration

<meta name="apple-mobile-web-app-capable" content="yes" />

I have an event that fires on scroll to change the title of the current month on my calendar web app. This works perfectly in safari when I load the page but after adding this meta tag and saving the app to my homescreen the event stoped firing as the scroll is decelerating. As long as my finger is on the screen it is able to change the title but the scroll event will no longer fire during the deceleration of the momentum scroll.

I understand that in the first releases of ios javascript was not fired during the scroll event but this was fixed in ios 8. Why would enabling apple-mobile-web-app-capable cause a regression in this behaviour?

$(".dates_container_m").on( 'scroll', function(){

  //change the title if scroll into next month

});

You need to know more info here:

Follow this link for more info: click here

Try this like this code:

document.addEventListener("touchmove", OnScrollStart, false);
document.addEventListener("scroll", OnScroll, false);

function OnScrollStart() {
    //start of scroll event for iOS
}

function OnScroll() {
    //end of scroll event for iOS
    //and
    //start/end of scroll event for other browsers
}

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM