Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
infinite-recycle-list
Advanced tools
Simple infinite scroll list with dom recycle for mobile web
#infinite-recycle-list
根据淘宝移动端增量加载列表改造而来,实现列表的增量加载,并对超出屏幕的列表页进行回收.
依赖于zepto或者jquery.
##Install
$ bower install infinite-recycle-list --save
##Example
var _list = new InfiniteList({
//必须,列表容器的选择器
listId:'list-container',
//必须,每页的大小,控制是否可以加载更多,和dataLoader里的页面大小需要保持一致
pageSize:10,
//必须,数据加载函数
dataLoader:function(pageindex,pagesize,success_calbak,error_calbak){
$.ajax({
url:'...',
type:'post',
data:{
...
pageindex:pageindex,
pagesize:pagesize
},
success:function(data){
success_calbak(data.list);
},
error:error_calbak
});
},
//必须,将数据绑定到模板
htmlRender:function(data){
return 'template-rendered';
},
//增量加载触发值,默认为300像素,最低为300
threshold:400,
//保持的DOM数量,最低为2(建议为偶数),默认为6
pageKeepSize:6,
//用户向上滑动列表,是否保留尾部的缓存数据,默认为false
recycle:true,
//是否缓存页面锚点位置
pageCache:true,
//缓存名称,默认为INFINITELISTCACHE,缓存页面锚点时数据缓存在sessionStorage中的名称
storageName:'storageName',
//可选,用户自定义列表没有更多显示的内容
listNomore:function(){
return '<div>No more</div>';
},
//可选,用户自定义列表加载提示信息
listLoading:'<div>Loading...</div>',
//可选,每页数据加载完成之后触发的函数
loadDone:function(){
//Do something
}
});
###API ####reloadData 重新加载指定页面的数据
<div id="list-container">
...
<li class="list-item-11"></li>
...
</div>
//自动重新加载屏幕中间位置页面的数据
_list.reloadData();
####clear 清空列表数据,并重新加载
_list.clear();
FAQs
Simple infinite scroll list with dom recycle for mobile web
The npm package infinite-recycle-list receives a total of 0 weekly downloads. As such, infinite-recycle-list popularity was classified as not popular.
We found that infinite-recycle-list demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.