
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
cdd-scroller
Advanced tools
tags: scroller
这是个移动端和pc端通用的检测滑动的库。
scroller({
fElement:dom<obj>,
threshold?:<number>,
arrived:<function>,
unarrived:<function>,
up?:<number>,
down?:<number>,
modal?:'debounce'/'throttle'<string>,
frequency?:250<number>
})
往 scroller中添加一个对象即可
debounce:防抖;throttle:减少频率;html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.f {
width: 200px;
height: 250px;
overflow-y: auto;
}
</style>
</head>
<body>
<div class="f">
<div class="s">
<p>项目_1</p>
<p>项目_2</p>
<p>项目_3</p>
<p>项目_4</p>
<p>项目_5</p>
<p>项目_6</p>
<p>项目_7</p>
<p>项目_8</p>
<p>项目_9</p>
<p>项目_10</p>
</div>
</div>
<script src="../dist/scroller.umd.js"></script>
<script>
var f = document.querySelector('.f')
var fun = {
arrived: function () {
console.log(`到了`)
},
unarrived: function () {
console.log(`离开了`)
}
}
var config1 = {
fElement: f,
modal: 'throttle',
frequency: '250',
up: 10,
},
config2={
fElement: f,
modal: 'throttle',
frequency: '250',
up: 10,
down:20
},
config3={
fElement: f,
frequency: '250',
};
var config = Object.assign({},fun,config1)
// var config = Object.assign({},fun,config2)
// var config = Object.assign({},fun,config3)
var scroller = new scroller(config)
</script>
</body>
</html>
FAQs
tags: scroller
We found that cdd-scroller 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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.