MCPcopy Index your code
hub / github.com/docsifyjs/docsify / scrollTo

Function scrollTo

src/core/event/scroll.js:13–31  ·  view source on GitHub ↗
(el, offset = 0)

Source from the content-addressed store, hash-verified

11let coverHeight = 0;
12
13function scrollTo(el, offset = 0) {
14 if (scroller) {
15 scroller.stop();
16 }
17
18 enableScrollEvent = false;
19 scroller = new Tweezer({
20 start: window.pageYOffset,
21 end:
22 Math.round(el.getBoundingClientRect().top) + window.pageYOffset - offset,
23 duration: 500,
24 })
25 .on('tick', v => window.scrollTo(0, v))
26 .on('done', () => {
27 enableScrollEvent = true;
28 scroller = null;
29 })
30 .begin();
31}
32
33function highlight(path) {
34 if (!enableScrollEvent) {

Callers 1

scrollIntoViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…