I am having trouble understanding how to use $(this) in a function. I
would like to refer to a div container by an image in that container.
The architecture is something like this:

<div class="container">
  <div class="subcontainer"><img class="trigger" src="" /></div>
</div>

Ideally I would use:

$(".trigger").click(function () {
     $(".container:has(this)").hide("slow");
});

But this doesn't work. I could use .parent().parent(), but that's bad
practice. What is the correct way to approach this problem? Thanks.

Reply via email to