Open yachen168 opened 3 years ago
https://yachen168.github.io/article/Smooth-Scrolling.html#more
在網頁開發中,錨點算是個常見的需求,例如:在點擊按鈕後,畫面想要蝦趴的「滑」到頂部。 這種平滑的滾動效果,其實只要加一行 CSS 就可以辦得到,無需勞動到 JS,也就是今天要介紹的 scroll-behavior 屬性,直接進入實作吧!
https://yachen168.github.io/article/Smooth-Scrolling.html#more
在網頁開發中,錨點算是個常見的需求,例如:在點擊按鈕後,畫面想要蝦趴的「滑」到頂部。 這種平滑的滾動效果,其實只要加一行 CSS 就可以辦得到,無需勞動到 JS,也就是今天要介紹的 scroll-behavior 屬性,直接進入實作吧!