Fancybox高度调整大小动态内容 [英] Fancybox Height Resize Dynamic Content
问题描述
我正在使用Fancybox 1.3.4来启动表格,如下所示:
I'm using Fancybox 1.3.4 to splash up and very unexciting table as follows:
function EditExtra() {
$("a.EditExtra").fancybox({
'zoomSpeedIn': 300,
'zoomSpeedOut': 300,
'overlayShow': true,
'autoDimensions': false,
'titleShow': false,
'height': 'auto',
'scrolling' : 'no',
'autoScale' : false,
'centerOnScroll' : true,
'showCloseButton': true
});
return false;
}
这很好用,但是当我使用一些jQuery从表中动态添加/删除表中的一行时,例如:
This works fine, but when I dynamically add / remove a line from the table using a bit of jQuery, such as:
function RemoveLine(){
$('img.removeline').live('click',function(){
$(this).closest("tr").remove();
$.fancybox.resize();
return false;
});
}
... fancybox的大小未调整为内容的新高度.将新行追加到表底部时,也会发生同样的情况.实际的表行插入/删除部分工作正常.我相信$ .fancybox.resize()函数应该将高度调整为新内容的大小,但由于某些原因,它无法正常工作.我花了很长时间来弄乱不同的参数!恩!
...the fancybox isn't resizing to the new height of the content. The same happens when appending a new row to the bottom of the table. The actual table row insert / remove part works fine. I believe the $.fancybox.resize() function should resize the height to the new content but for some reason it's not working. I've spend ages messing around with the different parameters! urgh!.
所有这些变幻莫测的是,如果添加一行,则它会在fancybox的边缘下方溢出,或者如果删除仅保持相同的高度,并且底部有空白空间.我还注意到,如果我使用带有不同行数的表调用fancybox,它将自动正确缩放高度以适合内容.
All that heppens is if adding a row it overflows below the edge of the fancybox, or if removing just stays the same height with loads of white space at the bottom. I also noticed that if I call the fancybox with a table of varying number of rows it auto scales the height correctly to fit the content.
任何帮助表示赞赏.
丹
推荐答案
正如Marco所说,答案是将AutoDimension设置为true?或执行$ .fancybox.showActivity
As Marco said, the answer was to set AutoDimension: true? Or do a $.fancybox.showActivity
这篇关于Fancybox高度调整大小动态内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!