2016-04-05 36 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/ –