I am running on mouseenter / mouseleave with jQuery and it seems to work, but not when I exit the div. This only works when exiting the actual window.
This is my jQuery
$(document).ready(function() { $(".pods .col").on("mouseenter", function() { $(this).find(".pod-overlay").addClass("show") }); $(".pods .col").on("mouseleave", function() { $(this).find(".pod-overlay").removeClass("show") }); });
This is my HTML.
<div id="splash" class="section section-splash bg"> <div class="pods"> <div class="col col-4"> <div id="pod-splash-food" class="pod pod-food"> <div class="pod-overlay"></div> </div> </div> </div> </div>
I made a js fiddle here. I am learning jquery, so advice is welcome.
http://jsfiddle.net/34h48148/
jquery mouseleave
Kirsty marks
source share