Question

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?

Was it helpful?

Solution

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();                     
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top