From 7c1ff8501e2ec1d279272d82f7d256ae8d421044 Mon Sep 17 00:00:00 2001 From: Valentin Date: Tue, 4 Jul 2023 22:31:53 +0200 Subject: [PATCH] tablehead sticky au scroll --- index.php | 9 +++++++++ resources/views/index.blade.php | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 301bcfc..e52ca13 100644 --- a/index.php +++ b/index.php @@ -34,6 +34,15 @@ for (let otherTableTd of otherTableTds) { otherTableTd.style.width = `${100 / 8 * 1.75}%`; } + // HEADER AU SCROLL + let tableHead = document.querySelector("thead tr"); + let tHeadHeight = tableHead.offsetHeight; + window.onscroll = () => { + tableHead.style.minHeight = `${document.querySelector("header").offsetHeight + 72}px`; + let scroll = window.pageYOffset; + let headerNewHeight = tHeadHeight - scroll; + tableHead.style.height = `${headerNewHeight}px`; + } }, false); diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 91f2c1b..377b7e0 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -16,7 +16,7 @@ - + @@ -24,7 +24,7 @@ - + 'post',
Images Voix Off et InÉcrits