GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fuyunv/dropload: 移动端下拉刷新、上拉加载更多插件

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
dist
dist
 
 
examples
examples
 
 
.gitignore
.gitignore
 
 
Changelog.md
Changelog.md
 
 
README.md
README.md
 
 
bower.json
bower.json
 
 

Repository files navigation

dropload

移动端下拉刷新、上拉加载更多插件

背景介绍

0.3.0(150410)

项目中通知列表有可编辑、删除等状态,需要锁定和解锁下拉刷新功能。

0.2.0(150325)

公司项目APP内嵌页需要下拉刷新,终于可以实战了!这一版大家可以开始使用和反馈。

0.1.0(141024)

虽然有上拉加载更多的需求,但一直都是用的scroll方法。写dropload完全是为了练习插件写法和touch的使用。

示例

扫一扫 DEMO链接

依赖

Zepto 或者 jQuery

使用方法

$('.element').dropload({
    loadUpFn : function(me){
        $.ajax({
            type: 'GET',
            url: 'json/update.json',
            dataType: 'json',
            success: function(data){
                alert(data);
                // 代码执行后必须重置
                me.resetload();
            },
            error: function(xhr, type){
                alert('Ajax error!');
                me.resetload();
            }
        });
    },
    loadDownFn : function(me){
        $.ajax({
            type: 'GET',
            url: 'json/more.json',
            dataType: 'json',
            success: function(data){
                alert(data);
                // 代码执行后必须重置
                me.resetload();
            },
            error: function(xhr, type){
                alert('Ajax error!');
                me.resetload();
            }
        });
    }
});

CSS样式请自行美化

参数列表

参数 说明 默认值 可填值
domUp 上方DOM {
domClass : 'dropload-up',
domRefresh : '<div class="dropload-refresh">↓下拉刷新</div>',
domUpdate : '<div class="dropload-update">↑释放更新</div>',
domLoad : '<div class="dropload-load">○加载中...</div>'
}
数组
domDown 下方DOM {
domClass : 'dropload-down',
domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
domUpdate : '<div class="dropload-update">↓释放加载</div>',
domLoad : '<div class="dropload-load">○加载中...</div>'
}
数组
distance 拉动距离 50 数字
loadUpFn 上方function 空 function(me){
//你的代码
me.resetload();
}
loadDownFn 下方function 空 function(me){
//你的代码
me.resetload();
}

API

暴露一些功能,可以让dropload更灵活的使用

lock() 锁定dropload

unlock() 解锁dropload

最新版本

0.3.0(150410)

  • 增加lock() 和unlock() API
  • 修复拉动加载时还可拉动bug

所有更新日志

About

移动端下拉刷新、上拉加载更多插件

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.