マウスがdivにカーソルを合わせたときに、divにオーバーレイを追加しようとしています。動作しますが、div内でマウスを動かしている間、オーバーレイは点滅し続けます。どうすればこれを防ぐことができますか?
HTML:
<div id="d4" class="dmc_block" style="width:60%; background:#eee; z-index:1">
<div style="padding:20px;">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. </p>
</div>
</div>
JS:
$('body').on('mouseenter','.dmc_block',function(){
var o = $(this).offset();
var h = $(this).height();
var w = $(this).width();
$('<div>').addClass('hover').css({width:w,height:h,left:o.left,top:o.top,position:'absolute',zIndex:2}).insertAfter(this);
}).on('mouseleave','.dmc_block',function(){
$('.hover').remove();
});
$('body').on('mouseenter','.hover',function(){return false;});
フィドル: http: //jsfiddle.net/T9Lhw/