Becs Carter Becs Carter - 1 year ago 65
jQuery Question

How to target the nth-child of $(this)

I am trying to target the nth child of an element on hover.

My html is this....

<div class="parent">
<div class="child1"></div>
<div class="child2"></div>
<div class="child3"></div>

At the moment,
, but on hover of
, I want to apply opacity to everything, and display
with no opacity over.

So far I have

$(".parent").hover(function() {

I need to use
as my markup is repeated on my page displaying different products. So I want to target just the particular product that I am hovering over.

Am I barking up the wrong tree?

Sorry if this is a dumb question, I know exactly what I want to do, but just can't quite execute it!

Answer Source

You can


Demo: Fiddle

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download