简体   繁体   中英

How to implement pull to refresh on existing hybrid app built using cordova

I have currently developed a hybrid app using cordova for ios & android. I wanted to add a feature which is pull to refresh in the app. I couldnt find any satisfying solutions to it. I have found many solutions for native app but none for hybrid app. Help me out here if possible thanks.

If your cordova App using javascript, I think PulltoRefresh.js is the best choose, very easy to add to your code.

PullToRefresh.init({
 mainElement: '#main', // above which element?
 onRefresh: function (done) {
 setTimeout(function () {
  done(); // end pull to refresh
  alert('refresh');
}, 1500);

} });

See demo at author site

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