let scroll=()=>{
const height = document.body.scrollTop||document.documentElement.scrollTop;
if (height>10) {
window.requestAnimationFrame(scroll)
window.scrollTo(0,height-height/8)
}
}
document.querySelector('.btn').addEventListener('click',()=>{
scroll()
})
document.querySelector('.btn').addEventListener('click',()=>{
//定位的目标元素 scrollIntoView api
document.querySelector('.uul').scrollIntoView({
block: 'start',
behavior: 'smooth'
})
})