Reputation: 2675
I have this jquery hover effect, how it works is there is one div that is invisible and when you hover over a div it slides the invisible div up, making it visible. When there are multiple divs and you hover over one div / box.. all the other invisible divs slide up, when just the div you hovered over should slide up. Here is my jquery for the slide up divs:
$(function(){
$(".video-entry-summary").hover(function() {
$(".videotntitle").stop(true,true).animate({'bottom': '+=211px' },200);
}, function() {
$(".videotntitle").stop(true,true).animate({'bottom': '-=211px' },200);
});
});
Here is the jsFiddle to demonstrate my problem.. and like I said, only one div should be sliding up, not all of them.
Any help would be appreciated!! :)
Upvotes: 2
Views: 678
Reputation: 5399
You are targeting the wrong selectors instead of the right ones.
You want to target
$(this).find('.videotntitle').stop(). etc etc;
Upvotes: 1
Reputation: 382112
You may specify the context to target the right div :
$(function(){
$(".video-entry-summary").hover(function() {
$(".videotntitle", this).stop(true,true).animate({'bottom': '+=211px' },200);
}, function() {
$(".videotntitle", this).stop(true,true).animate({'bottom': '-=211px' },200);
});
});
$(".videotntitle", this)
searches for the elements with class videotntitle
inside this
(which is the hovered element)
Upvotes: 4