문제

I have an image gallery where when you hover like to open a bar below the image with the download options. In inico managed to do, see the code - http://goo.gl/fhBC6

More I have a problem I do not know the solution: How do I activate the slideDown function only in li selected?

How can I fix this?

도움이 되었습니까?

해결책

You need to use this to select the element which the mouse is on it.
Change Your code to this: jsFiddle Live Demo

$('.photos-list').on('mouseenter', 'li', function(){
    $(this).find('.openDiv').slideDown();
});
$('.openDiv').on('mouseleave', function(){
    $('.openDiv').slideUp();
});

But i think it's better to use hover() : jsFiddle Live Demo (hover)

$('.photos-list li').hover(function(){
    $(this).find('.openDiv').slideDown();                                      
},function(){
    $('.openDiv').slideUp();                     
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top