How to make the slider arrows appear smoothly with a hover, as with the example of FlexSlider ?

How to make the slider arrows appear smoothly with a hover, as with the example of FlexSlider ?

The basic idea is to hide the arrows outside the slider, giving them the value left and right -50px at position: absolute. Set these values to positive when hovering. And add smoothness with transition.
#slider{ width: 500px; height: 150px; background: blue; position: relative; overflow: hidden; } .arrow{ position: absolute; width: 20px; height: 20px; top: 46%; background: #fff; opacity: 0; transition: 0.3s ease; } .left{ left: -20px; } .right{ right: -20px; } #slider:hover .left{ left: 20px; opacity: 1; } #slider:hover .right{ right: 20px; opacity: 1; } <div id="slider"> <div class="arrow left"></div> <div class="arrow right"></div> </div> Source: https://ru.stackoverflow.com/questions/444461/
All Articles