Arun Nair
Arun Nair

Reputation: 69

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.

Upvotes: 3

Views: 3365

Answers (1)

Vu Ngo
Vu Ngo

Reputation: 86

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

Upvotes: 2

Related Questions