How can I display a description on an image when hovering over it? I've been attempting to achieve this using jQuery, but the function doesn't seem to be working. Will my other functions interfere with each other even though they utilize different classes and ids?
Below is the code snippet in question:
$(document).ready(function() {
$('#box').hover(function() {
$('#details').show(500);
})
})
.box .details p {
font-size: 14px;
display: none;
}
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"></script>
<div class="col-lg-2 box" id="box">
<div class="imgBox">
<img class="product-mouseover" src="https://via.placeholder.com/150 C/O https://placeholder.com/" alt="">
</div>
<div class="details" id="details">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco</p>
</div>
</div>