Passer au contenu principal
Bluvy Tube
Appuyez sur Échap pour quitter le plein écran
Volume m
/
i
Mode Cinéma t
f
/
Do you still use JavaScript to track scroll position? Modern CSS can track scroll state for you. You can detect if users read your terms without scroll listeners. Here is how it works. #CSS #WebDev #JavaScript 1/4

Raccourcis clavier

Espace K
Lecture / pause
← →
Reculer / avancer de 5 s
J L
Reculer / avancer de 10 s
0–9
Aller à 0 %–90 % de la vidéo
Home End
Début / fin
, .
Image précédente / suivante (en pause)
< >
Ralentir / accélérer
↑ ↓
Volume
M
Couper / rétablir le son
C
Sous-titres
F
Plein écran
I
Image dans l’image
T
Mode cinéma
?
Afficher cette aide

Do you still use JavaScript to track scroll position? Modern CSS can track scroll state for you. You can detect if users read your terms without scroll listeners. Here is how it works. #CSS #WebDev #JavaScript 1/4

0 vue Publié le 24/09/2026 08:03 0:09
#javascript #webdev #css
Do you still use JavaScript to track scroll position? Modern CSS can track scroll state for you. You can detect if users read your terms without scroll listeners. Here is how it works. #CSS #WebDev #JavaScript 1/4
1 commentaire
?
1. CSS tracks the scroll.
Add container-type: scroll-state to the box.
A container query detects when the user reaches the bottom.

CSS then changes an invisible property on the button.
This property acts as a silent flag.

2/4
2. Simple JavaScript.
When the user clicks the button, scripts do not check scroll events.

They only read the computed CSS flag.
If the flag exists, the signup completes.
If not, a warning prompt appears.
This removes heavy scroll listeners completely.

3/4
Voir le post d'origine sur Bluesky
Lien copié dans le presse-papier

Connexion

Il est temps de faire une pause

Ça fait 30 minutes que vous enchaînez les vidéos : accordez-vous 5 minutes loin de l'écran. Levez-vous, étirez-vous, buvez un verre d'eau… Les vidéos vous attendront ici.