I didn't find the exact answer to my problem that I will explain here :
I want to hide a fixed element when the user is scrolling. When the scroll action is finished, the div is displayed again. This does not take into account a trigger on the height (with a scrollTop for example) but simply on the scroll action itself.
This behaviour is for mobile use.
I made a quick code snippet for trying something :
thanks a lot
window.addEventListener('scroll', function() {
document.getElementById('paragraph').classList.toggle('test');
});
p {
position:fixed;
background:wheat;
}
div {
height:2000px;
background-image: linear-gradient(red, yellow);
}
<div>
<p id="paragraph">Has to be hidden on scroll</p>
</div>