naive-ui icon indicating copy to clipboard operation
naive-ui copied to clipboard

Scroll animation for n-anchor

Open youyinnn opened this issue 2 years ago • 9 comments

This function solves the problem (这个功能解决的问题)

User experience improvement

Expected API (期望的 API)

As the title implies

youyinnn avatar Jan 10 '22 22:01 youyinnn

@07akioni 这个功能是不是可以跟 back top 一起加上

nooooooom avatar Jan 14 '22 07:01 nooooooom

@07akioni 这个功能是不是可以跟 back top 一起加上

这个应该会很繁琐,因为浏览器默认的 smooth 滚动是没有成功的回调的,你需要在中间停止监听这些

07akioni avatar Jan 14 '22 07:01 07akioni

相比于这个,我觉得当 item 太多导致 anchor 溢出时候内部的滚动更重要

07akioni avatar Jan 14 '22 07:01 07akioni

可以用 requestAnimationFrame 自己写个滚动,以此来调控滚动的时长以及动画函数

nooooooom avatar Jan 14 '22 07:01 nooooooom

可以用 requestAnimationFrame 自己写个滚动,以此来调控滚动的时长以及动画函数

当然是可以的,我觉得可以加

07akioni avatar Jan 14 '22 09:01 07akioni

想了想好像不用自己写,我也忘了为啥默认没用 smooth 了,或许是可以的

07akioni avatar Jan 14 '22 09:01 07akioni

想了想好像不用自己写,我也忘了为啥默认没用 smooth 了,或许是可以的

我下班看看直接用原生的有没有什么影响 我们倒计时那里有个 requestAnimationFrame 的插件,我觉得可以用起来,功能都是从一个量值过渡到另一个量值

nooooooom avatar Jan 14 '22 09:01 nooooooom

想了想好像不用自己写,我也忘了为啥默认没用 smooth 了,或许是可以的

我下班看看直接用原生的有没有什么影响 我们倒计时那里有个 requestAnimationFrame 的插件,我觉得可以用起来,功能都是从一个量值过渡到另一个量值

优先原生吧

07akioni avatar Jan 14 '22 13:01 07akioni

相比于这个,我觉得当 item 太多导致 anchor 溢出时候内部的滚动更重要

确实

youyinnn avatar Jan 15 '22 16:01 youyinnn