弹出窗口的动态高度取决于内容,有可能吗? [英] Dynamic height for popups depending on content, is it possible?
本文介绍了弹出窗口的动态高度取决于内容,有可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能得到一个始终为400px宽的窗口弹出窗口,但动态高度取决于弹出窗口中的内容?
我已经看到这个但不确定如何将它应用到弹出窗口中
调整iframe的宽度以适应内容 解决方案
已解决
$(document).ready(function(){
// For IE
var h = $('#page')。outerHeight();
var newH = h + 20;
window.resizeBy(0,newH - $(window).height() );
//只适用于Firefox / Safari
$('img')。load(function(){
var h = $('#page')。 outerHeight();
var newH = h + 20;
window.resizeBy(0,newH - $(window).height());
});
}) ;
Is it possible to get a window popup with always 400px wide, but dynamic height depending on the content in the popup window?
I have seen this but not sure how to apply it to popup windows
Adjust width height of iframe to fit with content in it
解决方案
Solved
$(document).ready(function() {
// For IE
var h = $('#page').outerHeight();
var newH = h + 20;
window.resizeBy(0, newH - $(window).height());
// Only works in Firefox/Safari
$('img').load(function() {
var h = $('#page').outerHeight();
var newH = h + 20;
window.resizeBy(0, newH - $(window).height());
});
});
这篇关于弹出窗口的动态高度取决于内容,有可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文