Search code examples
androidioscordovamulti-device-hybrid-apps

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.


Solution

  • 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