--- title: History.scrollRestoration slug: Web/API/History/scrollRestoration tags: - API - HTML DOM - History API - Property - Reference translation_of: Web/API/History/scrollRestoration ---
History.scrollRestoration
속성을 사용하면 기록 탐색 시 사용할 스크롤 위치 복원 기능의 기본값을 웹 애플리케이션이 지정할 수 있습니다.
let scrollRestore = history.scrollRestoration;
"auto"
"manual"
const scrollRestoration = history.scrollRestoration if (scrollRestoration === 'manual') { console.log('The location on the page is not restored, user will need to scroll manually.'); }
if (history.scrollRestoration) { window.history.scrollRestoration = 'manual'; }
Specification | Status | Comment |
---|---|---|
{{SpecName("HTML WHATWG", " #scroll-restoration-mode", "History.scrollRestoration")}} | {{Spec2("HTML WHATWG")}} | No change from {{SpecName("HTML5 W3C")}}. |
{{SpecName("HTML5 W3C", "browsers.html#dom-history-scrollrestoration", "History.scrollRestoration")}} | {{Spec2("HTML5 W3C")}} | Initial definition. |
{{Compat("api.History.scrollRestoration")}}