Skip to content

Class not updating #4290

Answered by ekwoka
OvalMedia asked this question in 1. Help
Jul 8, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Your scroll handlers this does not refer to the data context, it refers to the window.

You need to bind the handler, or ideally, just use alpine to register the handler.

<header x-data="stickyHeader" :class="{ 'hidden': hidden }" @scroll.window="scroll"></header>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@OvalMedia
Comment options

Answer selected by OvalMedia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants