title: How to call fancybox resize function when fancybox-wrap height changes
body: <p>I have need to show this gallery as <a href="http://tympanus.net/Tutorials/ResponsiveImageGallery/" rel="nofollow">http://tympanus.net/Tutorials/ResponsiveImageGallery/</a>  in fancy box.  It works fine except one design problem that is fancybox doesn't come in the center for first time as it has to download few image for first time if one open the same album second time it then show correctly in the center as all image are cached. I tried to resolve this issue with following code but it is not work</p>
  
  <p>I cant give fancybox fixed width and height as images are of different dimensions</p>
  
  <pre><code>$(".fancybox-frame").fancybox({
      maxWidth: 740,
      maxHeight: 600,
      fitToView: false,
      width: '70%',
      height: '70%',
      autoSize: true,
      closeClick: true,
      hideOnOverlayClick: true,
      openEffect: 'none',
      closeEffect: 'none',
      onComplete: function () {
          $.fancybox.resize();
          $.fancybox.center();
      }
  });
  </code></pre>
  
  <p>Other solution i can think of is to call <code>fancybox.center()</code> and <code>$.fancybox.center();</code> function  when fancybox wrapper with changes <code>fancybox-wrap</code>.</p>
  
  <p>This i can help me correctly repositioning the fancybox in center.</p>
  
  <p>But i am not sure how to track  height change for <code>fancybox-wrap</code> and call the reposition the fancy box.</p>
  
  <p>Fancybox V 1.3.4
  Help in this regarding is appreciated.</p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>Just to give you an idea i face similar problem that is happend on this link.</p>
  
  <p><a href="http://www.picssel.com/playground/jquery/getImageAjax.html" rel="nofollow">http://www.picssel.com/playground/jquery/getImageAjax.html</a></p>
  
  <p>When you click for the first time it small fancy-box and doesn't re-size when image is downloaded. In my case i have to download multiple image and it take time to display the first image in between takes default value but doent resize when first image is download. </p>