我有一个由Flickity插件提供支持的小型画廊,其中包含图像和 Youtube 嵌入视频。标记类似于:
<div class="carousel">
<div class="carousel-cell">
<img src="https://img.youtube.com/vi/EXeTwQWrcwY/maxresdefault.jpg">
<iframe src="https://www.youtube.com/embed/EXeTwQWrcwY"></iframe>
</div>
</div>
其中预览图像设置单元格的大小,并且 Youtube iframe 被绝对定位以覆盖单元格:
> iframe {
position: absolute;
top: 0; left: 0;
height: 100%; width: 100%;
}
问题是我在单击嵌入视频时实际上无法drag
使用轮播,因为它会播放/暂停视频,但会将视频保持在同一位置,即我无法选择它。有任何想法吗?