Using Jquery Fancybox auto height within an Iframe?

人走茶凉 提交于 2020-01-17 04:12:08

问题


I'm using Fancybox iframe form. form height 350px when finish form the result is just two lines.

could any one tell me how to make auto height for the window

my javascript code is

$(document).ready(function() {      
    $("#send_friend").fancybox({
        'width'             : 310,
        'height'            : 350,
        'autoScale'         : false,
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'type'              : 'iframe',
        'showCloseButton'       :false,
        'padding'           : 0,
        'margin'            : 0,
        'transitionIn'      : 'elastic',
        'transitionOut'     : 'elastic',    
        'overlayOpacity':'0.3', 
    });

});

Thanks in advance


回答1:


Try giving the iframe a matching height and width (see below), but more importantly give the finish form screen a firm height and width as well, if needed by wrapping it in a DIV tag.

<iframe style="height: 350px; width 350px;" />
...
<div style="height: 350px; width 350px;">
<form>
Thank you for sending to a friend.
</form>
</div>


来源:https://stackoverflow.com/questions/7375872/using-jquery-fancybox-auto-height-within-an-iframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!