🚀 Launch Week Day 2:Introducing Custom Tabs for Org Alerts.Learn More
Socket
Book a DemoInstallSign in
Socket

pullload

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pullload

上拉加载更多

Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

pullload

上拉加载更多

组件只判断是否加载更多, 业务逻辑由使用者编写

Install

npm install pullload --save-dev

Usage

new Pullload({
    //onScrollEnd 为 加载更多时的回调
    onScrollEnd : function(pullload){
    }
})

Methods

MethodDescription
stop停止
start启动
tick业务逻辑执行完毕

Example

var page = 1;
new Pullload({
    container : '#main',
    onScrollEnd : function(pullload){
        $.ajax({
            url: 'http://cmnt.sina.cn/aj/v2/index?page=' + page++,
            success: function(rs) {
                var str = '';
                rs.data.forEach(function(item, index) {
                    str += '<div></div>';
                })
                $('body').append(str);
                //当dom操作执行完毕后, 需要运行该方法, 以允许下一次判断
                pullload.tick();
            }
        })
    }
})

Keywords

pull

FAQs

Package last updated on 06 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts