MCPcopy
hub / github.com/docsifyjs/docsify / scrollIntoView

Function scrollIntoView

src/core/event/scroll.js:145–158  ·  view source on GitHub ↗
(path, id)

Source from the content-addressed store, hash-verified

143}
144
145export function scrollIntoView(path, id) {
146 if (!id) {
147 return;
148 }
149 const topMargin = config().topMargin;
150 const section = dom.find('#' + id);
151 section && scrollTo(section, topMargin);
152
153 const li = nav[getNavKey(path, id)];
154 const sidebar = dom.getNode('.sidebar');
155 const active = dom.find(sidebar, 'li.active');
156 active && active.classList.remove('active');
157 li && li.classList.add('active');
158}
159
160const scrollEl = dom.$.scrollingElement || dom.$.documentElement;
161

Callers 1

$resetEventsMethod · 0.90

Calls 3

configFunction · 0.85
scrollToFunction · 0.85
getNavKeyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…