Fancy box not opened on second time
<p>The below given code is not working on second time when i click the button. I called it using trigger(click) function of jquery.</p>

<pre><code>jQuery(document).ready(function(){
        jQuery('.fancybox').fancybox(
            {

               hideOnContentClick : true,
               width: 382,
               autoDimensions: true,
               type : 'iframe',
               showTitle: false,
               scrolling: 'no',
               onComplete: function(){
                jQuery('#fancybox-frame').load(function() { // wait for frame to load and then gets it's height
                    jQuery('#fancybox-content').height(jQuery(this).contents().find('body').height()+30);
                    jQuery.fancybox.resize();
                 });

               }
            }
        );
    });
</code></pre>
