Having a flickering and fading issue with an image overlay, I suspect it might be related to the css loading the overlay and then jQuery triggering?
.Image-Overlay {
width: 100%;
height: 100%;
background-color: rgba(0,0,0, 0.8);
z-index: 100;
display: none;
position: absolute;
top: 0;
cursor: pointer;
color: #fff;
box-sizing: border-box;
padding: 20px;
}
<div class="column xsmall-12 small-6 medium-3 overlay">
<img src="<?php echo get_template_directory_uri(); ?>
/img/insidePages/Layer90.jpg" alt="Kenya" />
<div class="Image-Overlay">
<p>content on overlay</p>
</div>
<h2>Title</h2>
</div>
$('.overlay').mouseenter(function () {
$('.Image-Overlay', this).fadeIn('slow');
}).mouseleave(function () {
$('.Image-Overlay', this).fadeOut('fast');
});
I was hoping for a sliding effect on hover but after checking the jQuery website, the effect doesn't seem to be working as expected. Any insights on what could be the issue?