Tag

scrollIntoView

1 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Dec 11, 2024 · Frontend Development

Implement Click-to-Scroll to Current User Position in a Vue3 Ranking List

This tutorial explains how to use Vue 3 to render a ranking list, add a unique data-key to each user item, and implement a click handler that smoothly scrolls the selected user into view with Element.scrollIntoView while optionally highlighting the element for two seconds.

DOMHighlightJavaScript
0 likes · 5 min read
Implement Click-to-Scroll to Current User Position in a Vue3 Ranking List
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
May 9, 2022 · Frontend Development

Mastering Smooth Scrolling: CSS, JavaScript Methods and Edge‑Case Solutions

This article explores how to implement smooth scrolling using CSS and JavaScript, compares native scroll APIs, demonstrates practical React examples, explains how to differentiate user‑initiated and script‑driven scrolling, and provides compatibility tips and workarounds for common pitfalls.

CSSJavaScriptreact
0 likes · 16 min read
Mastering Smooth Scrolling: CSS, JavaScript Methods and Edge‑Case Solutions