我在我的网站上构建了可翻转图像。我希望这些图像的“背面”具有与前面相同的尺寸。 我的问题是,我在我的图像上使用Bootstrap img-responsive类,所以“后”尺寸需要动态更新以匹配“前”。将元素的尺寸设置为等于响应图像尺寸
这是我假设想要做的事(我意识到CSS不可能像书面的,只是说明我的目标)。我正在使用ng-animate来制作动画过渡效果,并显示最初隐藏的“背面”并隐藏前面(我处于良好状态)。
HTML:
<img class="front img-responsive" src="path/to/img.jpg" alt="">
<div class="back">Info about image</div>
CSS:
.back {
height: [current height of .front]
width: [current width of .front]
}
你NG风格尝试过吗? – 2014-09-11 11:23:10
类似[THIS](http://jsfiddle.net/1mdwqt3o/)? – 2014-09-11 11:39:54
@Narek,谢谢你提到这个。我还没有真的使用过这个指令,但它看起来很有用! – MattDionis 2014-09-11 12:20:25