
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
coffee-loadmaster
Advanced tools
var loadMaster = new LoadMaster({
container: window, //滚动的容器,默认是window的scroll,也可以指定div,可以传字符串或者原生element
offset: window.innerHeight, //当前视觉屏以外的安全距离,提供像素数字,默认是容器的一屏高度
threshold: window.innerHeight, //触发的区域高度,提供像素数字,默认是容器的一屏高度
trigger: ['above', 'curr', 'below'], //触发的事件,有三个值above/below/curr。
items: 'div', //触发的元素列表,提供选择字符串
optimize: true, //是否做滚动优化
});
刷新触发的元素列表,当添加了新的elements的时候调用
//刷新触发的元素列表,当添加了新的elements的时候调用
loadMaster.refresh();
移除滚动事件监听
//移除滚动事件监听
loadMaster.off();
top/bottom/left坐标值,height高度,el原生元素
//eles 都是原生的elements数组
//当指定的元素移动到距离当前屏幕上方指定距离的时候调用的回调事件
loadMaster.on('above', function(eles, dir, top, data, isFast) {
console.log(eles);
});
//当前屏幕的元素,如果dir为undefined则为默认进来的首屏
loadMaster.on('curr', function(eles, dir, top, data, isFast) {
console.log(eles);
});
//当前屏幕滚动下方,进入触发区域的元素
loadMaster.on('below', function(eles, dir, top, data, isFast) {
console.log(eles);
});
//滚动到容器地步,可以在这里绑定异步获取事件
loadMaster.on('end', function() {
//添加dom,然后刷新触发元素
this.refresh();
});
LoadMaster提供一个静态方法calc,专门用于计算元素在页面所处的坐标值
这个方法可以接受一个参数,这个参数可以是三种类型
string接受选择字符串,会返回数组el原生的DOM元素,会返回对象eles原生的DOM元素数组,会返回数组LoadMaster.calc(el); // {el: div, top: 0, left: 0, bottom: 0, height: 100}
FAQs
load module
We found that coffee-loadmaster 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
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.