Legacy Problem Jquery

Legacy Problem Jquery

Hello,
I have always the same problem with jquery i don't know how solve the problem of Legacy.

$('.pins').parent(this).click(function(event) {
event.stopPropagation();
              $index  = $(this).index();
$opacity = $('.pins_span_right_top').css('opacity')
if ($('.pins_span_right_top').css('opacity') == '0')
{
    $('.pins_span_right_top').css('opacity','1');
}
else
{
$('.pins_span_right_top').css('opacity','0');
}
});

The div father is .pins
The div children is .pins_span_right_top

But when I click on .pins_span_right_top jquery think i click on .pins 
The Child .pins_span have the same event as .pins
I tried event.stopPropagation() and event.preventDefault() but no sucess.

Someone would have the same problem or know how solve it?
Thanks you and sorry for my English mistakes I'm French.