Hello,
It seems like you're trying to toggle visibility of certain elements when hovering over an image. Your jQuery code looks mostly correct, but you might be missing the part where you handle the mouse leaving the image to revert the changes. Here's a revised version of your script that should work:
<span class="col-md-3">
<img id="image" class="img-fluid" src="images/home/pic_meeting.png">
<div class="black-box">
<span class="black-box-content">
<center>MEETING</center>
</span>
</div>
<div class="black-box-hover">
<span class="black-box-content">
<center>
MEETING<br><br>
We are extremely happy to<br>
provide refined catering services for your special<br>
events! By choosing<br>
us, you get a guarantee that<br>
everything.<br>
</center>
</span>
</div>
...
<script>
$(document).ready(function() {
$(".black-box-hover").hide();
$("#image").hover(
function() {
// Mouse enters the image area
$(".black-box").hide();
$(".black-box-hover").show();
},
function() {
// Mouse leaves the image area
$(".black-box-hover").hide();
$(".black-box").show();
}
);
});
</script>
This script uses the hover function which takes two arguments: one for when the mouse enters the element (mouseenter) and one for when the mouse leaves the element (mouseleave). When the mouse enters the image area, the .black-box is hidden and the .black-box-hover is shown. When the mouse leaves, the .black-box-hover is hidden and the .black-box is shown again.
Make sure that your CSS is set up correctly so that the .black-box-hover is positioned over the image and is initially hidden. Also, ensure that jQuery is properly included in your page.
If you're using Bootstrap (as suggested by the col-md-3 class), you might also want to ensure that your HTML structure adheres to Bootstrap's grid system, typically requiring a .row to wrap columns.
I hope this helps! Let me know if you have any further questions.