🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.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.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

上拉加载更多

介绍

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

用法

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

方法

MethodDescription
stop停止
start启动
tick允许进行下一次判断

举例子

var page = 1;
new Pullload({
    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 27 Mar 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