Table of Contents Table of Contents Four choices Hard Case The projector unit Valerion Visionmaster Plus 2 - other features Audio The Remote Conclusion Valerion Visionmaster Plus 2 in numbers Show Full Guide Table of Contents Four choices Hard Case The projector unit Show Full Guide Valerion Visionmaster Plus 2 - other features Audio The Remote Conclusion Valerion Visionmaster Plus 2 in numbers window.addEventListener("DOMContentLoaded", () => { const header = document.querySelector(".header_wrapper"); const pageLegend = document.querySelector('#multiCollapse1'); const pageLegendList = document.querySelector('#multiCollapse2'); const pageLegendCollapse = new bootstrap.Collapse(pageLegend, {toggle: document.querySelector(".toc-sticky").classList.contains('sticky')}); /** * Changing current title */ (function (pageLegend) { const titleNodes = pageLegend.querySelectorAll('.StepProgress-item__link'); if (!titleNodes.length) return; const titles = [...titleNodes].map((itm, i) => ({ id: itm.getAttribute('data-id'), text: itm.textContent, level: itm.getAttribute('data-level'), linkNode: itm, titleNode: document.getElementById(itm.getAttribute('data-id')), index: i, })); /** * Source: https://www.sitepoint.com/throttle-scroll-events/ * @param {Function} fn * @param {number} wait * @returns {(function(): void)|*} */ const throttle = (fn, wait) => { let time = Date.now(); return function () { if ((time + wait - Date.now()) < 0) { fn(); time = Date.now(); } } } const changeCurrentTitle = () => { const documentScrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; let current = 0; // Title titles.forEach((itm, i) => { //console.log(itm) const itmOffsetTop = itm.titleNode ?