jquery - When items are hovered fast they're not returning to its default state -
with reference this question
when mouseenter on each item, overlay disappearing, when mouseleave - overlay shows.
when have more items, , fast hovering on them randomly, they're not returning it's previous state. it's quite annoying :/
why that?
$('.item').mouseenter(function () { var $this = $(this); settimeout(function () { $this.find('.item-overlay').css('z-index', '-1'); }, 300); }).mouseleave(function () { $(this).find('.item-overlay').css('z-index', '1'); });
try hover(): http://jsfiddle.net/kfs9h/
$(".item").hover( function () { $(this).find('.item-overlay').stop().css('z-index', '-1'); }, function () { $(this).find('.item-overlay').stop().css('z-index', '1'); } );
Comments
Post a Comment