title: call Fancybox in parent from iframe
body: <p>I have 2 pages, my index.html and social.html. I cleaned out my index and left only the jquery code need for <a href="http://fancybox.net/" rel="noreferrer">fancybox</a> What I am trying to do is to have images inside social.html and when clicked on it, it would open fancybox and show it but in index.html not inside the iframe. The error that comes up is:</p>
  
  <pre><code>Uncaught TypeError: Property 'showImage' of object [object DOMWindow] is not a function
  (anonymous function)social.html:103
    onclick 
  </code></pre>
  
  <p>this is my index.html:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/jquery.fancybox-1.3.4.pack.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="css/jquery.fancybox-1.3.4.css" media="screen" /&gt;
  &lt;script type="text/javascript" src="js/video.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
          function showImage(image) {
              $.fancybox('&lt;img src="img/' + image + '" alt="" border="0" /&gt;');
          };
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;iframe src="social.html" scrolling="no" border="0" width="579" height="505" allowtransparency="true"&gt;&lt;/iframe&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>in IFrame page:</p>
  
  <pre><code> &lt;img src="img/picture1.jpg" alt="" class="thumbs" onclick="parent.showImage('picture1.jpg');"/&gt;
  </code></pre>
  
  <p>PS: both pages are on same domain...
  EDIT: video.js -> this is from fancybox I didn't make this.</p>
  
  <pre><code>jQuery(document).ready(function() {
  
      $(".video").click(function() {
          $.fancybox({
              'padding'       : 0,
              'autoScale'     : false,
              'transitionIn'  : 'none',
              'transitionOut' : 'none',
              'title'         : this.title,
              'width'         : 640,
              'height'        : 385,
              'href'          : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
              'type'          : 'swf',
              'swf'           : {
              'wmode'             : 'transparent',
              'allowfullscreen'   : 'true'
              }
          });
  
          return false;
      });
  
  
  
  });
  </code></pre>