我在滑块模块https://codepen.io/anon/pen/oVqzpe中使用了这个jQuery插件。我想在图像的轮播中添加具有灰色背景色的div。这是我的代码:
<div class="container-slider demo-1">
<div id="layer_div">
<img src="{{asset('assets/img/isc.png')}}" style="position: absolute;z-index: 10;top: 12%;left: 44%;">
<div id="image-slider">
@foreach(App\Http\Controllers\SliderController::getEnableSlider() as $slider)
@if(File::exists($slider->photo))
<img src="{{ asset($slider->photo) }}">
<span><h1>{{ Session::get('locale') == 'fr' ? $slider->title_fr : $slider->title_en }}</h1></span>
@endif
@endforeach()
</div>
</div>
</div>
ID为layer_div
的div是我想成为父滑块div的层的那个。我知道我应该使用的CSS是这样的:
height: 100%;
width: 100%;
background-color:rgba(0,0,0,0.3);