title: Start fancybox on all anchor tags with image inside
body: <p>I am having issues with starting up fancybox. I'd like to use fancybox on all images inside #content block. All the images have following code:</p>
  
  <pre><code>&lt;a href="img.jpg"&gt;
  &lt;img title="title" src="img.jpg" alt="alt" width="225" height="169"&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I don't want to use special class for the link (pictures are managed by user through tinymce). I tried:</p>
  
  <pre><code>$("#content a").has('img').fancybox({
  ..fancybox settings
  });
  </code></pre>
  
  <p>and as well</p>
  
  <pre><code>$("#content a img").parent('a').fancybox({
  ..fancybox settings
  });
  </code></pre>
  
  <p>without any luck. <code>$("#content a").has('img').hide()</code> works perfectly - so selecting the proper element is just fine. </p>
  
  <p><strong>EDIT:</strong> Maybe for better understanding: using <code>$("#content a")</code> works, but works on all <code>&lt;a&gt;</code> tags, meaning that as well simple links like <code>&lt;a href="google.com"&gt;google&lt;/a&gt;</code> are "fancyboxed".</p>
  
  <p><strong>EDIT2:</strong> HTML code:</p>
  
  <pre><code>&lt;div id="content"&gt;
  &lt;p&gt;Lots of text.
      &lt;a href="href"&gt;
          &lt;img src="src" alt="alt" width="225" height="169" /&gt;
      &lt;/a&gt;
  &lt;/p&gt;
  &lt;p&gt;another text&lt;/p&gt;
  &lt;p&gt;more text &lt;a href="http://www.google.com"&gt;Simple link which should not be opened by fancybox&lt;/a&gt;&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thx for any ideas.</p>