13

I am using JQuery Mobile and I've seen a couple of Pull to Refresh Scripts around.

I especially like this one but even the demo doesn't seem to work on their website.

My question is ... does anyone know of any working pull to refresh scripts for web apps?

Satch3000
  • 47,356
  • 86
  • 216
  • 346

4 Answers4

4

I have built my own jQuery / jQuery Mobile plugin (pull to refresh and infinite scrolling are supported): https://github.com/zippy1978/jquery.scrollz

zippy1978
  • 632
  • 5
  • 3
  • Hi Zippy, I really liked ur plugin but I dont know why it makes scrolling hard. I mean it somehow removed my window scrolling event and scrolling became little rough. Also when I "bottomreached", it scrolls to the top instead of staying at the same location. I hope this can help you to improve ur plugin. Currently I am writing my own code but if you can fix above mentioned issues in ur plugin, please let me know I would like to use ur plugin. – user20072008 Oct 14 '14 at 03:05
3

Demo

Code Base for pull to refresh

Saurabh Chandra Patel
  • 12,712
  • 6
  • 88
  • 78
1
$("body").ready(function _onbodyready() {
    var $feedback = $('#feedback');
    $("#main-content-div")
      .pullToRefresh()
     .on("end.pulltorefresh", function (e, percent){
      $feedback.html("ok");
   })
     .on("move.pulltorefresh", function (e, percent){
      $feedback.html(percent + ' %');
     })

});

Ir Calif
  • 460
  • 6
  • 7
0

Highly recommend the Pull to Refresh library here. Just implemented it and it works great.

For a basic functionality, go to their GitHub and download the index.umd.min.js file and include it. Then, use the following code:

PullToRefresh.init({
  mainElement: '#main_div',
  onRefresh: function() { location.reload(); }
});

This will mimic the functionality you can see here in this demo

Rob Rouse Jr.
  • 69
  • 1
  • 6