Pull to Refresh Javascript
Asked Answered
S

4

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?

Scabrous answered 13/11, 2011 at 9:35 Comment(0)
G
4

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

Geniality answered 30/8, 2012 at 20:31 Comment(1)
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.Alysiaalyson
S
3

Demo

Code Base for pull to refresh

Selfconfessed answered 18/9, 2013 at 5:44 Comment(0)
R
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 + ' %');
     })

});

Roncesvalles answered 24/8, 2016 at 6:26 Comment(0)
O
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

Oust answered 11/8, 2020 at 18:55 Comment(1)
this doessnt work if you have 2 instancesFossil

© 2022 - 2024 — McMap. All rights reserved.