我创建了gallery组件,我想在点击时全屏打开图像。我认为只需为gallery.component.ts
中的3个图像创建3个函数
下面是我在gallery.component.html
中编写的代码:
<div class="col-lg-4 col-md-4 col-xs-4 thumb mb-4">
<a class="thumbnail" href="#">
<img class="img-responsive rounded" src="../../assets/images/small/01.Gg1ZD.jpg" alt="">
</a>
</div>
<div class="col-lg-4 col-md-4 col-xs-4 thumb mb-4">
<a class="thumbnail" href="#">
<img class="img-responsive rounded" src="../../assets/images/small/02.wWNQN.jpg" alt="">
</a>
</div>
<div class="col-lg-4 col-md-4 col-xs-4 thumb mb-4">
<a class="thumbnail" href="#">
<img class="img-responsive rounded" src="../../assets/images/small/03.ZFJbM.jpg" alt="">
</a>
</div>
没有图书馆也能做到吗?
1条答案
按热度按时间goqiplq21#
要以全屏方式打开图像,可以使用ng-image-fullscreen-view等库