jQuery Cycle 插件的问题
这是原始划分:
应用 jquery 循环插件后的图像像这样离开底部边框:
有什么想法吗?
这是分区的 css:
#hero {
float: right;
border-top: 1px solid #FFF;
width: 725px;
height: 370px;
background: #666;
}
#wave {
width: 970px;
height: 40px;
position: absolute;
left: 0;
bottom: 0;
background: url(../img/wave.png) no-repeat bottom left;
}
This was the original division:
after applying jquery cycle plugin the image gets out of its bottom border like this:
Any ideas why ?
Here is the css of the division:
#hero {
float: right;
border-top: 1px solid #FFF;
width: 725px;
height: 370px;
background: #666;
}
#wave {
width: 970px;
height: 40px;
position: absolute;
left: 0;
bottom: 0;
background: url(../img/wave.png) no-repeat bottom left;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
位置从相对位置更改为绝对位置(通过循环插件),这导致 z-index 发生变化,就像 @Orbling 所说的那样。如果您希望边框位于旋转器中图像的顶部,则可以绝对或相对地定位它们,并为它们指定高于容器的 z 索引。
修复方法:显式定位下部波浪“边框”元素(
position:relative; 或position:absolute;)
* 并为其指定高于旋转器元素的 z 索引。*如果元素未明确定位,则为元素提供比旋转器更高的 z 索引将不起作用。请参阅 http://www.webdevout.net/test?0_
Position changed from relative to absolute (by the cycle plugin), which caused a z-index change like @Orbling said. If you want the border to be on top of the images in the rotator, you absolutely or relatively position them and give them a z-index higher than the container.
To fix: Explicitly position the lower wavy "border" element (
position:relative; or position:absolute;)
* and give it a z-index higher than that of the rotator element.*giving the element a higher z-index than the rotator will not work if the element isn't explicitly positioned. see http://www.webdevout.net/test?0_
循环插件使用 z-index,这可能是您问题的根源。从循环插件代码来看:
我会使用“wave”的 z-index 来看看这是否有帮助。
The cycle plugin uses the z-index, that is likely the source for your problem. From the cycle plugin code:
I'd play with the z-index of the "wave" and see if that doesn't help.