コードセグメントは、ブラウザウィンドウの表示領域をスクロール滑らかにする要素を指定することができます。
constのsmoothScroll =要素=> document.querySelector(要素).scrollIntoView({ 動作:「スムーズ」 }); smoothScroll( '#fooBar' ); smoothScroll( '.fooBar');
コードセグメントは、ブラウザウィンドウの表示領域をスクロール滑らかにする要素を指定することができます。
constのsmoothScroll =要素=> document.querySelector(要素).scrollIntoView({ 動作:「スムーズ」 }); smoothScroll( '#fooBar' ); smoothScroll( '.fooBar');