3

我正在尝试将 div 元素放在jQuery 工具可滚动图片库上。我已经以正确的方式放置了所有东西,但是即使我设置了 z-index: 2,div 也不会出现在 jQuery 对象的顶部。这是我的代码:

div#wrapperContainer{
display: table;
overflow: hidden;
margin: -5px auto;
}

//this is the div i'm trying to put on top of the jQuery Tool
div#wrapper {
display: table-cell;
vertical-align: middle;
z-index: 2;
width: 1024px;
height: 192px;
background-color: #525252;
-moz-box-shadow: 0px -10px 50px #000; 
-webkit-box-shadow: 0px -10px 50px #000; 
        box-shadow: 0px -10px 50px #000;
}

//this is the CSS for the jQuery Tool

.scrollable {
position: relative;
overflow: hidden;
width: 940px;
height: 528px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
 -khtml-border-radius: 10px;
        border-radius: 10px;
}

.items {
width: 20000em;
clear: both;
position: absolute;
}

.items  div{
float: left;
width: 940px;
height: 528px;
}
4

2 回答 2

3

你能绝对定位包装器 div 吗?如果是这样,那应该连同适当的 z-index 一起处理它。

请参阅此处的定位示例。

于 2011-11-08T23:55:31.700 回答
0

看看jQuery.toggle()

于 2011-11-08T23:18:17.027 回答