All Projects → apeatling → Web Pull To Refresh

apeatling / Web Pull To Refresh

Licence: mit
A native-like JavaScript pull to refresh implementation for the web.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Web Pull To Refresh

Pulltorefresh H5 Iscroll
基于IScroll5的PullToRefresh实现.。提供多套皮肤机制,便于拓展!
Stars: ✭ 56 (-89.43%)
Mutual labels:  pull-to-refresh, pulltorefresh
Pullrefresh
前端, 下拉刷新
Stars: ✭ 7 (-98.68%)
Mutual labels:  pull-to-refresh, pulltorefresh
Smartrefreshlayout
🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
Stars: ✭ 23,185 (+4274.53%)
Mutual labels:  pull-to-refresh, pulltorefresh
XCPullToLoadMoreListView
XCPullToLoadMoreListView-下拉加载更多ListView控件(仿QQ、微信聊天对话列表控件)
Stars: ✭ 24 (-95.47%)
Mutual labels:  pulltorefresh, pull-to-refresh
Xrefreshview
一个万能的android下拉上拉刷新的框架,完美支持recyclerview
Stars: ✭ 1,685 (+217.92%)
Mutual labels:  pull-to-refresh, pulltorefresh
Minirefresh
优雅的H5 下拉刷新。零依赖,高性能,多主题,易拓展。(A Graceful HTML5 Drop-Down-Refresh Plugin. )
Stars: ✭ 1,525 (+187.74%)
Mutual labels:  pull-to-refresh, pulltorefresh
Pullrefreshlayout
下拉刷新,上拉加载,真实的回弹(overscroll)效果(媲美qq),且大小只有37KB(是其他主流刷新库或回弹库的1/2,1/3,甚至是1/4),同时,自定义header和footer,可以实现任何你想的到的功能(例如:自动触发加载更多、二级刷新等)
Stars: ✭ 639 (+20.57%)
Mutual labels:  pull-to-refresh, pulltorefresh
Xrefreshlayout
【已过时,不再更新,请使用更强大的SmartRefreshLayout!】A refresh layout(无侵入下拉刷新和加载布局), can refresh RecyclerView for all LayoutManager, NestedScrollView。
Stars: ✭ 127 (-76.04%)
Mutual labels:  pull-to-refresh, pulltorefresh
Springview
🔥 A custom view pull to refresh,support ScrollView,ListView,RecyclerView,WebView and all another views, easy to use
Stars: ✭ 1,936 (+265.28%)
Mutual labels:  pull-to-refresh, pulltorefresh
AnimatedPullToRefresh-master
A Cool pull to refresh widget provided with character animation in header with user defined text. Customise your widget and show off your home screen!!
Stars: ✭ 38 (-92.83%)
Mutual labels:  pulltorefresh, pull-to-refresh
Flutter whirlpool
Flutter UI challenge (with Box2D physic)- Smart washing machine app
Stars: ✭ 453 (-14.53%)
Mutual labels:  app
React Native Pull Refresh
Custom pull to refresh component for Android
Stars: ✭ 456 (-13.96%)
Mutual labels:  pull-to-refresh
Superslide.js
A flexible, smooth, GPU accelerated sliding menu for your next PWA
Stars: ✭ 496 (-6.42%)
Mutual labels:  app
Activitywatch
The goal of ActivityWatch is simple: Enable the collection of as much valuable lifedata as possible without compromising user privacy.
Stars: ✭ 5,927 (+1018.3%)
Mutual labels:  app
Musicvisualization
Some music visualization demos on android.
Stars: ✭ 455 (-14.15%)
Mutual labels:  app
Assetsextractor
『Assets提取工具』是一款OSX平台上用于将Assets.car或xxx.app中打包的png图片、pdf等资源重新提取出来的开发者工具。Assets.car常见于iOS/Mac/Unity等开发中的资源打包。
Stars: ✭ 486 (-8.3%)
Mutual labels:  app
Murmur
📻 A third-party android client of DoubanFM.
Stars: ✭ 454 (-14.34%)
Mutual labels:  app
Pulltorefresh
Flutter相关的项目QQ:277155832 Email:2[email protected]
Stars: ✭ 454 (-14.34%)
Mutual labels:  pulltorefresh
Swiftpulltorefresh
An easy way to implement pull-to-refresh feature based on UIScrollView extension, written in Swift 4.
Stars: ✭ 451 (-14.91%)
Mutual labels:  pull-to-refresh
Pulltorefresh
A PullToRefresh widget.
Stars: ✭ 522 (-1.51%)
Mutual labels:  pulltorefresh

Pull to Refresh for the Web 1.1

Web Pull to Refresh

This is a pull to refresh implementation for the web. It focuses on buttery UX performance and responsiveness to feel as close to a native implementation as possible.

Try a Demo | Read the Blog Post

Usage

There are two core elements needed, the content element and the pull to refresh UX element. The demo uses this setup, but you can modify this however you'd like.

<div id="ptr">
  <!-- Pull down arrow indicator -->
  <span class="genericon genericon-next"></span>

  <!-- CSS-based loading indicator -->
  <div class="loading">
    <span id="l1"></span>
    <span id="l2"></span>
    <span id="l3"></span>
  </div>
</div>

<div id="content">
  <!-- Content that should be draggable for refreshing goes in here -->
</div>

This will work just fine with your own loading indicators or pull down arrow, just make sure they're wrapped in the element you're using to hold the pull to refresh UX. Don't forget to include the CSS if you want to use a similar visual setup as the demo.

In order for this to function, you'll need to load both Hammer.js and the wptr.js script, and then initialize the WebPullToRefresh module. Add this just before the closing body tag:

<script src="lib/hammer.2.0.4.js"></script>
<script src="lib/wptr.1.0.js"></script>

<script>
  window.onload = function() {
    WebPullToRefresh.init( {
      loadingFunction: exampleLoadingFunction
    } );
  };
</script>

You will also need to provide a loading function at initization time. This function should perform the async loading pieces you need to load new items, and return a promise.

var exampleLoadingFunction = function() {
  return new Promise( function( resolve, reject ) {
    // Run some async loading code here

    if ( /* if the loading worked */ ) {
      resolve();
    } else {
      reject();
    }
  } );
};

Optional Parameters

There are a few optional parameters you can pass on initialization:

{
	// ID of the element holding dragable content area
	contentEl: 'content', 

	// ID of the element holding pull to refresh loading area
	ptrEl: 'ptr', 

	// Number of pixels of dragging down until refresh will fire
	distanceToRefresh: 70, 

  // The dragging resistance level, the higher the more you'll need to drag down.
  resistance: 2.5
}

Try a Demo | Read the Blog Post

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].