$scroll and !show #124
Answered
by
KevinBatdorf
carstenjaksch
asked this question in
Q&A
-
Hey, I am super excited for the convenient $scroll helper – thanks a lot! The element should trigger a scroll to the top and hide itself, both on click. But setting the variable Code: <div
class="scroll-top mouse"
x-data="{ show: false }" <!-- hidden by default -->
x-show.transition.duration.400ms="show"
@scroll.window="show = true" <!-- show on scroll -->
<!-- hide and scroll to top most element on click -->
@click="
show = false;
$scroll(document.getElementsByClassName('ct-section')[0]);
"></div> Am I missing something? |
Beta Was this translation helpful? Give feedback.
Answered by
KevinBatdorf
Apr 23, 2021
Replies: 1 comment 3 replies
-
Is this because you have |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
carstenjaksch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this because you have
show = true
in thescroll.window
event listener? You probably need something extra there to not run that code under some conditions.