HTML:
<div id="container" class="container">
<img id="cover" src="1.jpg">
<ul class="list">
<li>列表1</li>
<li>列表2</li>
<li>列表3</li>
<li>列表4</li>
<li>列表5</li>
<li>列表6</li>
<li>列表7</li>
<li>列表8</li>
<li>列表9</li>
<li>列表10</li>
</ul>
</div>
CSS:
.container {
width: 256px; height: 360px;
border: 1px solid #eee;
max-width: calc(100% - 2rem);
margin: auto;
overscroll-behavior: none;
overflow: auto;
}
.container img {
width: 100%;
height: 192px;
display: block;
}
.list {
list-style: none;
padding: 0;
background-color: #fff;
position: relative;
}
.list li {
padding: 8px 10px;
border-top: 1px solid #eee;
text-align: left;
}
页面内JS:
<script id="workletScript" language="animationworklet">
registerAnimator('passthrough', class {
animate(currentTime, effect) {
effect.localTime = currentTime;
}
});
</script>