MCPcopy
hub / github.com/scutan90/DeepLearning-500-questions / sticky

Function sticky

docsify.js:3731–3743  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3729 }
3730
3731 function sticky() {
3732 var cover = getNode('section.cover');
3733 if (!cover) {
3734 return
3735 }
3736 var coverHeight = cover.getBoundingClientRect().height;
3737
3738 if (window.pageYOffset >= coverHeight || cover.classList.contains('hidden')) {
3739 toggleClass(body, 'add', 'sticky');
3740 } else {
3741 toggleClass(body, 'remove', 'sticky');
3742 }
3743 }
3744
3745 /**
3746 * Get and active link

Callers 1

renderMixinFunction · 0.85

Calls 2

getNodeFunction · 0.85
toggleClassFunction · 0.85

Tested by

no test coverage detected