jQuery function similar to closest that will return elements outside of the parent chain
<p>Is there any jQuery function similar to closest() that will return elements outside of the parent chain, traversing sideways? For example, I want to call a function foo() on the div source that would return the div target. I know I could navigate using parent() and siblings(), but I need something generic that would go as many levels as needed, up, sideways and down?</p>

<pre><code>var allsources = $('.source');

allsources.click(function()){
  $(this).closest('.target').hide();
});

&lt;div class="row"&gt;
  &lt;div&gt;
     &lt;div class="target" &gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;div class="source"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class="row"&gt;
  &lt;div&gt;
     &lt;div class="target" &gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;div class="source"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>EDIT: </p>

<p>My definition of closest: you have an element source. Try to find it down. If find more than one, return one that is less node hoops down/next/prev. If not found, go one level up, and try to find again. Repeat until no parent.</p>
