Mouseenter儿童在鼠标悬停时闪烁

时间:2013-03-13 19:11:30

标签: jquery html

当我将鼠标悬停在滑块上时,我正在尝试显示导航栏。导航栏位于其中,如您所见:

http://jsfiddle.net/warface/GhY3R/2/

当鼠标悬停在导航栏上时,如何避免这个小故障?

$(function(){    
/* Slider nav mouseover thingy*/
    $('#slider').mouseenter(function(e){
        $('.portfolio nav').show();
    });
    $('#slider').mouseleave(function(e){
        $('.portfolio nav').hide();
    });
});


<div class="portfolio">    
    <div id="slider"></div>
    <nav>
        <a class="next" data-slider="slider" rel="next">▶</a>
        <a class="prev" data-slider="slider" rel="prev">◀</a>
    </nav>
</div>

1 个答案:

答案 0 :(得分:1)

请参阅:Fiddle

$(function(){    
  /* Slider nav mouseover thing*/
  $('#slider,nav').mouseenter(function(e){
     $('.portfolio nav').show();
  });
  $('#slider').mouseleave(function(e){
     $('.portfolio nav').hide();
  });
});