The html is like this:
<div class="a_list">
<div class="hide_list_scrollbar"></div>
</div>
<div class="a_list">
<div class="hide_list_scrollbar"></div>
</div>
The js is like this:
$(".a_list").mouseenter(
function(){
$(".hide_list_scrollbar").hide();
}
);
$(".a_list").mouseleave(
function(){
$(".hide_list_scrollbar").show();
}
);
Right now, the mouse event is performed on all the “a_list” divs. I only want to perform the mouse event on the particular div that actually activated the mouse event, not all of the “a_list” divs. How do I achieve this? Thanks!
Add a context to the selector. See below,
Full Code:
Or you can use
.findlike below,Note: I have chained your call to reduce the query to DOM.