If you have a div that sits at the bottom of a slideshow that you want to disappear when the user scrolls down, and then reappears when scrolls back to the top, you can follow the below example.
<div>
<div class="a">
A
</div>
</div>
$(window).scroll(function() {
if ($(this).scrollTop() > 0) {
$('.a').fadeOut();
} else {
$('.a').fadeIn();
}
});
Hope it is useful for someone 🙂
Revisions
- January 26, 2022 @ 16:41:22 [Current Revision] by Sharing Solution
- January 26, 2022 @ 16:41:22 by Sharing Solution
No comments yet.