我意识到这是非常基本的,但不能为我的生活工作,为什么我不能让它工作并且花了最后几个小时尝试一切
我需要将 DIV 堆叠起来,使它们形成一个大长柱,一个在另一个之上。它们包含在 JQuery 可滚动 DIV 中。我可以将所有 DIVS 绝对定位在里面,但是它们的负载会经常变化,所以如果我必须插入一个新的,它们会自动排列。
所以我基本上有一个大的可滚动 DIV。在这里面我有 2 个其他 DIV(#Release-Monsters 和 #Release-Insides),每个 DIV 都包含 3 个进一步的 DIV。我想将这 2 个 DIV(#Release-Monsters 和 #Release-Insides)堆叠在一起形成一列。一旦我有这两个工作,我会增加大约 50 个左右。
我的 CSS 是这样的:
#All-Releases- {
position:absolute;
left:250px;
top:210px;
width:600px;
height:600px;
z-index:3;
}
/* Used to control height of scrollable div*/
p.ex
{
height:600px;
width:100px;
}
/* Vertical and horizontal scrollbar - one extra step required - add width of overview - overall width of scrolled content*/
#All-Releases- {
width: 500px;
}
#Release-Monsters {
position:static;
width:600px;
height:322px;
z-index:3;
}
#Artwork-Monsters {
position:absolute;
left:19px;
top:2px;
width:284px;
height:284px;
z-index:3;
}
#Release-Title-Monsters {
position:absolute;
left:322px;
top:0px;
width:284px;
height:284px;
color: #CCC;
font-size: 18px;
font-family: Century Gothic, Geneva, sans-serif;
letter-spacing: 2px;
text-align: justify;
z-index:3;
}
#Release-Info-Monsters {
position:absolute;
left:322px;
top:25px;
width:278px;
height:284px;
color: #CCC;
font-size: 12px;
font-family: Century Gothic, Geneva, sans-serif;
letter-spacing: 1px;
text-align: justify;
z-index:3;
}
#Release-Insides {
display:block;
width:600px;
height:322px;
z-index:3;
}
#Artwork-Insides {
position:absolute;
left:19px;
top:2px;
width:284px;
height:284px;
z-index:3;
}
#Release-Title-Insides {
position:absolute;
left:322px;
top:0px;
width:284px;
height:284px;
color: #CCC;
font-size: 18px;
font-family: Century Gothic, Geneva, sans-serif;
letter-spacing: 2px;
text-align: justify;
z-index:3;
}
#Release-Info-Insides {
position:absolute;
left:322px;
top:25px;
width:278px;
height:284px;
color: #CCC;
font-size: 12px;
font-family: Century Gothic, Geneva, sans-serif;
letter-spacing: 1px;
text-align: justify;
z-index:3;
}
HTML是这样的:
<div id="All-Releases-" class="default-skin demo">
<div id="Release-Monsters">
<div id="Artwork-Monsters"><img src="images/Release-Artwork/Monsters.jpg" width="284" height="284" /></div>
<div id="Release-Title-Monsters">MONSTERS</div>
<div id="Release-Info-Monsters">
1. Prologue<br />
2. Journey <br />
3. Candles <br />
4. Water <br />
5. Underwater <br />
6. Spores <br />
7. Campfire <br />
8. Dawn <br />
9. Attack <br />
10. Temple <br />
11. Encounter <br />
12. Monsters Theme
</div></div>
<div id="Release-Insides">
<div id="Artwork-Insides"><img src="images/Release-Artwork/Insides.jpg" width="284" height="284" /></div>
<div id="Release-Title-Monsters">INSIDES</div>
<div id="Release-Info-Insides">
1. The Wider Sun <br />
2. Vessel <br />
3. Insides <br />
4. Wire <br />
5. Colour Eye <br />
6. Light Through The Veins <br />
7. The Low Places <br />
8. Small Memory <br />
9. A Drifting Up <br />
10. Autumn Hill<br />
</div></div>
<p class="ex"></p>
</div>
<div id="All-Releases-" class="default-skin demo">
<div id="Release-Monsters">
<div id="Artwork-Monsters"><img src="images/Release-Artwork/Monsters.jpg" width="284" height="284" /></div>
<div id="Release-Title-Monsters">MONSTERS</div>
<div id="Release-Info-Monsters">
1. Prologue<br />
2. Journey <br />
3. Candles <br />
4. Water <br />
5. Underwater <br />
6. Spores <br />
7. Campfire <br />
8. Dawn <br />
9. Attack <br />
10. Temple <br />
11. Encounter <br />
12. Monsters Theme
</div></div>
<div id="Release-Insides">
<div id="Artwork-Insides"><img src="images/Release-Artwork/Insides.jpg" width="284" height="284" /></div>
<div id="Release-Title-Monsters">INSIDES</div>
<div id="Release-Info-Insides">
1. The Wider Sun <br />
2. Vessel <br />
3. Insides <br />
4. Wire <br />
5. Colour Eye <br />
6. Light Through The Veins <br />
7. The Low Places <br />
8. Small Memory <br />
9. A Drifting Up <br />
10. Autumn Hill<br />
</div></div>
<p class="ex"></p>
</div>
<script type="text/javascript">
$(window).load(function () {
$(".demo").customScrollbar();
});
</script
>