How can I make it so that when an image is hovered over, it automatically scrolls to the bottom of the image?
I have a couple of questions:
How can I ensure the image scrolls to the end when hovered over? Currently, when I hover over the image, it doesn't scroll to the bottom.
Is there a way to control the speed of the scroll when hovering over an image?
Here is my code:
body {
margin: 2px auto;
width: 500px;
}
.pic {
width: 48%;
height: 200px;
overflow: hidden;
margin: 0 auto;
display: inline-block;
position: relative;
cursor: pointer;
}
.pic:before {
width: 100%;
height: 200px;
background: rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
}
.pic:after {
color: #fff;
font-size: 18px;
position: absolute;
top: 50%;
left: 50%;
margin: -20px -25px;
border: 1px solid rgba(255, 255, 255, 0.5);
padding: 10px;
}
img {
max-width: 100%;
cusor: pointer;
}
.pic:hover img {
animation: moveSlideshow 3s linear;
}
@keyframes moveSlideshow {
100% {
transform: translateY(-60%);
}
}
.pic:hover .pic:after {
opacity: 0;
}
<div class="pic"><img src="http://scr.templatemonster.com/51600/51651-big.jpg" alt="" /></div>
<div class="pic"><img src="http://www.cssauthor.com/wp-content/uploads/2014/06/Good-to-Go-single-page-PSD-template1.jpg" alt="" /></div>