Seeking guidance on creating a hover effect where an image inside a div moves upward upon hovering.
Current code snippet:
<div id="div1">
<div id="div2">
<img src="http://dummyimage.com/300x300/000/fff" width="300px" height="300px">
</div>
</div>
CSS styles:
#div1 {
width: 300px;
height: 300px;
border: 2px black solid;
position: absolute;
top: 100px;
left: 500px;
overflow: hidden;
}
#div2 img {
position: absolute;
top:200px;
}
The image within div1 currently sits at the bottom with overflow hidden. The goal is to make it move up on hover.
Considering using CSS transform and translateY for this effect, but open to suggestions on how JQuery could achieve the same result.
Any thoughts or ideas are appreciated!