简体   繁体   中英

overflow-scrolling : touch bind scroll position for cordova ios

When the scroll feature is assigned to an element with CSS;

For example:

#page{
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}

<div id="page"></div>

How to bind with a sliding movement of these elements JavaScript ??

I've tried something like this but not working !!!

$('#page').on('scroll',function(e){
 var scrollPosition = e.target.scrollTop;
console.log(scrollPosition);
});

This code on iOS devices triggered only finished the scroll position and updates. I would like to bind all the scrolls as momentary movements of the diver with a scroll feature.

Scroll movement does not return a value until it is completed we make a quick stop scrolling the screen. Scroll motion (momentum scroll) finished upgrader. I try to do to prevent it and how I can do this momentum scroll to bind???

This example ( http://adliy.com/scroll ) running iOS safari but this example does not work in WebView as we receive a cordovan project's my problem with it

Use this, it will definitely work. Add the style in your parent tag:

style="display: block; overflow-y: scroll; -webkit-overflow-scrolling: touch;"

overflow-y: scroll;

-webkit-overflow-scrolling: touch;

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