<div class="col-xs-12 col-sm-4">
<div class="thumbnail-container">
<img class="img-responsive" src="http://placehold.it/1024x768" alt="...">
<div class="thumbnail-overlay"></div>
<p class="text-center text-nowrap" style="display:block">title</p>
</div>
</div>
function overlay () {
$('.thumbnail-container > .text-center').mouseenter(function () {
$('.thumbnail-container > .thumbnail-overlay').fadeOut(500)
})
$('.thumbnail-container > .text-center').mouseleave(function () {
$('.thumbnail-container > .thumbnail-overlay').fadeIn(500)
})
}
I have 6 of those "thumbnail-container"
and I'd like to execute that jquery code only when a single of them is hovered (obviously). Right now when i hover a "p.text-center"
the code fades out ALL the divs in ALL the 6
containers. I've tried putting the "this"
keyword anywhere but it still not working.