我想调整整个 Galleria div 的大小并调整使用 Galleria 脚本动态生成的所有图像的大小。
到目前为止我有
$(window).resize(function() {
var h = $(window).height();
var galleriaHeight = h-54;
var w = $(".content").width();
var galleriaWidth = w-18;
$("#galleria").height(galleriaHeight);
$("#galleria").width(w);
$(".galleria-stage").height(galleriaHeight);
$(".galleria-stage").width(galleriaWidth);
$(".galleria-images .galleria-image img").css({"max-height":"auto"});
$(".galleria-images .galleria-image img").css({"max-width":galleriaWidth-36});
$(".galleria-stage").height(galleriaHeight);
$(".galleria-stage").width(galleriaWidth);
$(".galleria-container").width(w);
$(".galleria-container").height(galleriaHeight);
$(".caption").width(w);
$(".counter-nav").width(w);
var sidebarHeight =h-54;
var contentHeight =h-36;
$(".sidebar1").height(sidebarHeight);
$(".content").height(contentHeight);
});
但是一切都在不均匀地扩展并且非常混乱。查看全屏代码后,我还添加了
this.bind(Galleria.RESCALE, function() {
POS = this.getStageHeight() - tab.height() - 2;
thumbs.css('top', OPEN ? POS - list.outerHeight() + 2 : POS);
var img = this.getActiveImage();
if (img)
{
fixCaption(img);
}
});
但这也不起作用...
我想我想在调整大小后重新加载页面,但在运行中......或调整所有元素相对于彼此的大小,或使用 Galleria 调整大小脚本......
有任何想法吗?