i need some help with a problem. I have a sticky header, and he's actually coming from top to bottom while scrolling.
I need to make a javascript that makes it stop when it meets a specific element with a data-attribute.
Lets say this is the the structure
<div class="header" data-attribute="header-sticky"></div>
<div class="destination element" data-attribute="destination">
</div>
<div class="destination element" data-attribute="destination">
</div>
<div class="destination element" data-attribute="destination2">
</div>
i want to make the logic to stop it when scrolling when it reaches the first data-attribute. (the idea is that we gonna stop it at first data-attribute selected if there is more than one with the same name) otherwise we can decide which element we have to reach (for example destination2)
Thank you all