【发布时间】:2019-01-04 18:12:44
【问题描述】:
我目前有一个图片库,其中左侧有一张全尺寸图片,左侧图片库中的所有其他图片如下所示:
<div class='col-md-7'>
<img src='something'>
</div>
<div class='col-md-5'>
<ul>
<li ng-repeat for all the images in the array>
<img thumbnail for the image, on click it changes the source of the main image>
</li>
</ul>
</div>
问题是,图像可以有不同的高度,并且随着 img 高度的变化,主容器和每个缩略图的高度也会发生变化(因为它们会响应父尺寸)。有没有办法确定画廊的初始高度并在用户更改图像时保持这种高度?我不想设置一个静态数值,因为它应该随着屏幕大小而缩放,并且因为同一页面中可以有多个画廊,我需要每个画廊记住它自己的高度。
正如您在示例中看到的,我使用的是 bootstrap 和 angularJS 以及 jQuery,因此这些框架可用的工具是可用的。
【问题讨论】:
标签: jquery html css angularjs twitter-bootstrap