簡體   English   中英

ngx-gallery 寬度和高度選項缺失

[英]ngx-gallery width and height options missing

我想知道,如何給 ngx-gallery ( https://github.com/MurhafSousli/ngx-gallery ) 一個新的高度。 它有一個 500px 的固定值,改變父 div 的高度並沒有改變任何東西。

我正在尋找這樣的模板中的某些屬性

<gallery
   [height] = '250px'>
</gallery>

Stackblitz: https://stackblitz.com/edit/angular-osh1vu

后續問題:在 Stackblitz 中,行為是適合高度(關於黑色背景),而在我的應用程序中,它是適合寬度,因此黑色條紋在圖像上方和下方。 我怎么能改變這個呢? (這在舊版本上是可能的,但不再是有效屬性)

或者

一些 css 代碼(在開發工具中查看,滑動圖像標記為 div.g-template.g-item-template),也無法覆蓋:

div.g-template.g-item-template {
  height: 200px !important;
}

演示將 class 添加到圖庫元素

<div class="basic-container">
    <h2>Gallery component</h2>
    <gallery class="custom"
    [items]="items"
    [dots]=true
    [thumb]=false
    [loop]=false
    [playerInterval] = 5000
    [autoPlay]=true
    [loadingStrategy]=preload>
  </gallery>
</div>

在 css 更改

.custom{
height:200px;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM