1

当我单击按钮时,下面给出的代码第二次不起作用。我使用 jquery 的 trigger(click) 函数调用它。

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();
                 });

               }
            }
        );
    });
4

0 回答 0