GithubHelp home page GithubHelp logo

alloypullrefresh's Introduction

H5下拉刷新组件

特性

  • 定义下拉刷新元素样式
  • 下拉刷新事件回调
  • 支持zepto版本和react版本

示例

使用方法

react版本

var PullRefresh  = require('.PullRefresh/PullRefresh.jsx');

var PostListItem = React.createClass({
	render: function(){
		return (
            <div className="wrap" id="wrap">
                <PullRefresh onRefresh={this.onRefresh} container={'wrap'}/>
                <div className="scroll-content"></div>
            </div>
        )
	}
});

zepto版本

<script type="text/javascript" src="../src/zepto/pullRefresh.js"></script>
<link rel="stylesheet" type="text/css" href="../src/zepto/pullRefresh.css">




<div class="tuijian-container" id="container">
  <div class="pull-down-content">
    <div id="arrowIcon"></div>
    <div id="pullIcon" class="spinner" style="display: none;"></div>
    <span id="pullText">刷新成功</span>
  </div>
  <div id="wrapper" class="wrapper ">
    <ul id="recommend-hot-list" class="ul recommend-hot-list">
        
    </ul>
  </div>
</div>



<script type="text/javascript">
	
	AlloyPullRefresh.init({
       	container: '#container'
    });
</script>

配置说明

参数 类型 描述 必需 默认值
dragThreshold number 临界值 0.3
moveCount number 位移系数 200
beforePull function 下拉刷新触发前调用
afterPull function 下拉刷新触发后调用
onRefresh function 下拉刷新回调方法

License

Copyright(c) 2016-2017 AlloyTeam. Licensed under MIT license.

alloypullrefresh's People

Contributors

lvming6816077 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.