问题
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