2016-04-05 170 views
0

我正在使用Fotorama滑塊插件,您可以在其中以全屏方式打開圖像。我需要的背景是透明的,但我似乎無法改變它。Fotorama透明背景

您可以通過單擊來查看我的意思,並在全屏幕的小滑塊中打開其中一幅圖像。

我試圖在滑塊背景更改爲以下:

background: rgba{0,0,0,0); 
+0

,我把它放在'.fotorama- -fullscreen',我看到你已經在你的CSS中的評論,作品(*它只是該網頁幾乎沒有任何圖像周圍的空間,所以它只顯示白色或搜索框偶爾*) –

回答

0

有可能 - 我用下面的代碼了它自己:

.fullscreen .fotorama--fullscreen { 
    background: transparent !important; 
} 

.fullscreen .fotorama__wrap { 
    background: rgba(0,0,0,0.7) !important; 
} 

.fullscreen .fotorama__img { 
    top: 0px !important; 
    width: 50% !important; 
    height: auto !important; 
    margin: auto !important; 
    left: 0px !important; 
} 
1

這是關於這部分代碼:

.fotorama--fullscreen .fotorama__nav, .fotorama--fullscreen .fotorama__stage { 
    background: #000; 
} 

但是你不能將其設置爲透明,你可以將其設置爲白色。或者你可以添加一個特定的圖像。

編輯

,因爲你在一個全屏模式,默認情況下進入你不能將其設置爲透明,背景設爲黑色。你可以通過你想要的顏色來改變這種顏色,但是你永遠不會看到你網站的內容。

看到這個職位上的SO:

Background/element goes black when entering Fullscreen with HTML5

+0

我已經添加了'.fotorama - fullscreen .fotorama__nav,.fotorama - fullscreen .fotorama__stage { background:url(http://www.clauson-kaas.com/cgi-files/transparent.png)!important; }' 但它沒有任何區別 – Nreck

+0

對,我的答案不清楚,但我解釋得好一點。事實上,使用這個插件,你可以進入全屏模式。查看我的更新回答 –

+0

檢查fotorama選項以更改此行爲:http://fotorama.io/customize/options/ –