Fix rendering of new rail

This commit is contained in:
2026-05-17 10:36:23 +02:00
parent 3e765aa54f
commit d3e896d74e
8 changed files with 58 additions and 34 deletions
+17
View File
@@ -0,0 +1,17 @@
document.addEventListener("DOMContentLoaded", function () {
var rail = document.querySelector(".right-rail");
if (!rail) return;
var header = document.querySelector("header");
if (!header) return;
function updateTop() {
if (getComputedStyle(rail).position !== "fixed") {
rail.style.top = "";
return;
}
var rect = header.getBoundingClientRect();
rail.style.top = Math.max(8, rect.bottom + 8) + "px";
}
window.addEventListener("scroll", updateTop, { passive: true });
window.addEventListener("resize", updateTop);
updateTop();
});