{{title}}
{{description}}
<script>
(function () {
function initStickyMenu() {
const menu = document.querySelector('.uc-scroll');
if (!menu || menu.dataset.stickyInit) return;
menu.dataset.stickyInit = 'true';
// Создаём место для меню, чтобы контент не прыгал
const placeholder = document.createElement('div');
placeholder.style.height = '0px';
menu.parentNode.insertBefore(placeholder, menu);
let isFixed = false;
function updateMenu() {
const shouldFix =
placeholder.getBoundingClientRect().top <= 0;
if (shouldFix && !isFixed) {
placeholder.style.height = menu.offsetHeight + 'px';
menu.style.setProperty('position', 'fixed', 'important');
menu.style.setProperty('top', '0', 'important');
menu.style.setProperty('left', '0', 'important');
menu.style.setProperty('width', '100%', 'important');
menu.style.setProperty('z-index', '9999', 'important');
isFixed = true;
}
if (!shouldFix && isFixed) {
['position', 'top', 'left', 'width', 'z-index']
.forEach(prop => menu.style.removeProperty(prop));
placeholder.style.height = '0px';
isFixed = false;
}
if (isFixed) {
placeholder.style.height = menu.offsetHeight + 'px';
}
}
window.addEventListener('scroll', updateMenu, { passive: true });
window.addEventListener('resize', updateMenu);
if (window.ResizeObserver) {
new ResizeObserver(updateMenu).observe(menu);
}
updateMenu();
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initStickyMenu);
} else {
initStickyMenu();
}
})();
</script>