I've implemented a bootstrap card with a stretched-link to redirect users to the content page upon clicking on the card.
However, when utilizing the stretched-link, the hoverImage fails to change accordingly.
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="card">
<div class="my-image">
<img th:src="@{/images/a.png}" class="mainImage card-img-top" alt="...">
<img th:src="@{/images/a_hov.png}" class="hoverImage card-img-top" alt="...">
</div>
<div class="card-body">
<h5 class="card-title">Content</h5>
<p class="card-text">View and update the content</p>
<a href="https://www.example.com/content" class="card-link stretched-link"></a>
</div>
</div>
</div>
</div>
</div>
This is the CSS rule set I'm currently utilizing for hover effects.
.my-image .mainImage {
display: block;
}
.my-image .hoverImage {
display: none;
}
.my-image:hover .mainImage {
display: none;
}
.my-image:hover .hoverImage {
display: block;
}
I'm exploring the possibility of using JavaScript to enable the hover effect and get the stretched-link functionality to work together. Thoughts?