Get Code
<style>
.figure {
position: relative;
width: 360px; /* can be omitted for a regular non-lazy image */
max-width: 100%;
}
.figure img.image-hover {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
object-fit: contain;
opacity: 0;
transition: opacity .2s;
}
.figure:hover img.image-hover {
opacity: 1;
}
</style>
<script src=”https://scripts.sirv.com/sirvjs/v3/sirv.js”></script>
<div class=”figure”>
<a href=”https://www.example.com/”>
<img class=”Sirv image-main” src=”https://demo.sirv.com/hc/Bose-700-a.jpg?w=10&colorize.color=efefef” data-src=”https://images-na.ssl-images-amazon.com/images/I/61Qww5I5UzL.jpg”>
<img class=”Sirv image-hover” data-src=”https://images-na.ssl-images-amazon.com/images/I/51UXMv6OdJL.jpg”>
</a>
</div>
0 Comments