Not sure if this is possible. I want to select all elements with a class name and only affect the one element being hovered at that time and not the whole class. i can't use ids since they are a lot.
$('.hideme').hover(function(){
$('.hideme').hide();
});
and then.
<div class='hideme'></div>
when the above hides, the following shouldn't hide.
<div class='hideme'></div>
<div class='hideme'></div>
<div class='hideme'></div>
Not sure if this is possible. I want to select all elements with a class name and only affect the one element being hovered at that time and not the whole class. i can't use ids since they are a lot.
$('.hideme').hover(function(){
$('.hideme').hide();
});
and then.
<div class='hideme'></div>
when the above hides, the following shouldn't hide.
<div class='hideme'></div>
<div class='hideme'></div>
<div class='hideme'></div>
Share
Improve this question
asked Nov 1, 2013 at 8:29
RelmRelm
8,29520 gold badges69 silver badges114 bronze badges
1 Answer
Reset to default 9If you try to hide
by using clss name
, then DOM will hide all the element with same name.
So you have to use this
keyword for selecting current hovered
element.
Try following:
$('.hideme').hover(function(){
$(this).hide();
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745534632a4631850.html
评论列表(0条)