The code below is what I currently trying to make. As the result you can see just a bunch of buttons, I want to hide the buttons while the user is scrolling. Cause I can't insert code with code snippet :( so I just paste here:
$(function() {
$(window).on('scroll', function() {
$('ul.side-sticky-nav').addClass('hide-side-sticky-nav');
setTimeout(function() {
$('ul.side-sticky-nav').removeClass('hide-side-sticky-nav');
}, 150);
});
});
ul.side-sticky-nav {
list-style-type: none;
padding: 0;
width: 50px;
margin: 8px;
position: fixed;
right: 0;
bottom: 10%;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
ul.side-sticky-nav li {
width: 100%;
height: 0;
padding-bottom: 100%;
border-radius: 100%;
margin: 8px 0;
background: blue;
}
.hide-side-sticky-nav {
right: -40px!important;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div style="height: 2000px; background: gray;">
<ul class="side-sticky-nav">
<li>
<a></a>
</li>
<li>
<a></a>
</li>
</ul>
</div>
What we should pay attention when using animation with js? Thank you!