# pull-load **Repository Path**: degercode/pull-load ## Basic Information - **Project Name**: pull-load - **Description**: 一款兼容PC和移动设备的下拉刷新和上拉加载的组件,同时也支持滚动到底部加载和初始化后即开始加载 - **Primary Language**: JavaScript - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 6 - **Created**: 2017-02-17 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pull-load 一款兼容PC和移动设备的下拉刷新和上拉加载的组件,同时也支持滚动到底部加载和初始化后即开始加载 gitHub: https://github.com/xiyan1120/pull-load OSChina: https://git.oschina.net/564468767/pull-load 尊重原创,转载请注明转自:https://my.oschina.net/u/164010/blog/833722       ###1.引入js: ``` javascript ``` ###2.使用: ``` javascript new PullLoad({ //整个滚动层的容器的dom container:document.getElementById("outerScroller"), //指定滚动条的dom,不指定默认为container //scrollBar:document.getElementsByTagName("body")[0], down:{ distance:50,//默认距离 enable:true, callback:function (end) { setTimeout(function () { console.log("end"); var isEmptyData = false; end(isEmptyData); },1500); } }, up:{ distance:50,//默认距离,也是创建的div的默认g高度 isScrollLoad:false, isInitLoad:false, enable:true, callback:function (end) { setTimeout(function () { console.log("end"); var isEmptyData = false; end(isEmptyData); },1500); } } }); ``` ###3.up: ``` javascript up:{ //这个距离是用于匹配是显示上拉加载更多,还是显示释放加载 distance:50, //创建的div的容器,也是下面设置的html的父级 container:'
', //初始化时显示的html init:'