在jQuery Cycle幻灯片上方的z索引处显示div [英] Displaying a div at a z-index above a jQuery Cycle slide show
问题描述
我在这里使用 jQuery循环插件:幻灯片位于相对定位的div中,并且包含一个绝对定位的div,用于容纳字幕.该div位于自行车图像上方,但是无论我给标题div加上什么z索引,图像都将其隐藏.
The slides are in a relatively positioned div and it contains an absolutely positioned div to hold captions. This div is positioned above the cycling images but no matter what z-index I give the caption div the images hide it.
有没有办法让我的字幕div高于循环图像?
Is there a way to get my caption div above the cycle images?
#homeslides {
margin:0 auto;
width:985px;
height:420px;
overflow:hidden;
position:relative;
padding-top:12px;
}
#homeslideCaptions {
position:absolute;
bottom:0;
width:907px;
height:57px;
z-index:2000000;
background:rgba(0,0,0,0.5);
}
推荐答案
在此处获得答案:字幕div位于幻灯片显示容器中....孩子会像幻灯片一样被对待.
captions div is inside slideshow container....as a child will be treated like a slide.
需要对您的slidehsow ...位置相对包装,然后在其中放置标题.周期会将幻灯片的z-index递增1,因此可以使幻灯片的z-index至少比幻灯片数多一个
Need an outer wrapper for your slidehsow...position relative, then position captions inside that. Cycle will incremet slides z-index by 1, so a z-index of at least one more than slide count will work
这篇关于在jQuery Cycle幻灯片上方的z索引处显示div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!