最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jquery - Pull to Refresh Javascript - Stack Overflow

programmeradmin3浏览0评论

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?

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?

Share Improve this question asked Nov 13, 2011 at 9:35 Satch3000Satch3000 49.4k89 gold badges224 silver badges349 bronze badges
Add a comment  | 

4 Answers 4

Reset to default 4

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

Demo

Code Base for pull to refresh

$("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 + ' %');
     })

});

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

发布评论

评论列表(0)

  1. 暂无评论