- Messages
- 1,682
- Reaction score
- 32
- Points
- 48
HTML:
<div class="singlewhiteBox_body floatContainer" id="textbook">
<script>
$(document).ready(function() {
$('.row, .lastRow').hover(function() {
var ID = $(this).attr('id');
//alert(ID);
$('#'+ID+' .class').toggleClass('class_hover');
}, function() {
var ID = $(this).attr('id');
$('#'+ID+' .class').toggleClass('class_hover');
});
$('.chapter').hover(function() {
$(this).toggleClass('chapter_hover');
}, function() {
$(this).toggleClass('chapter_hover');
});
});
</script>
<div class="left">
<div class="row" id="CK1">
<div class="class">CK1</div>
<div class="chapterContainer">
<a href=""><span class="chapter">二十二 至 二十三</span></a>
<a href=""><span class="chapter">二十二 至 二十三</span></a>
<a href=""><span class="chapter">二十二 至 二十三</span></a>
<a href=""><span class="chapter">二十二 至 二十三</span></a>
</div>
</div>
<div class="lastRow" id="CK2">
<div class="class">CK2</div>
<div class="chapterContainer">
<a href=""><span class="chapter">二十二 至 二十三</span></a>
<a href=""><span class="chapter">二十二 至 二十三</span></a>
<a href=""><span class="chapter">二十二 至 二十三</span></a>
<a href=""><span class="chapter">二十二 至 二十三</span></a>
</div>
</div>
</div>
<div class="right">
</div>
</div>
Code:
#textbook .left, #textbook .right {
border: 1px solid #777777;
border-top: 4px solid #777777;
border-bottom: 4px solid #777777;
width: 49%;
}
#textbook .row, #textbook .lastRow {
width: 100%;
text-align: center;
padding-bottom: 0; /* ALERT */
border-bottom: 2px solid #777777;
color: #000000;
}
#textbook .lastRow {
border: 0;
}
#textbook .row:hover, #textbook .lastRow:hover {
background: #ffd899;
}
#textbook .row .class, #textbook .lastRow .class {
width: 55px;
height: 100%;
position: relative;
font-size: 20px;
border-right: 2px dashed #777777;
margin-right: 10px;
float: left;
}
#textbook .row .chapterContainer, #textbook .lastRow .chapterContainer {
width: 362px;
float: right;
text-align: left;
}
#textbook .row .chapterContainer a, #textbook .lastRow .chapterContainer a {
text-decoration: none;
}
#textbook .row .class_hover, #textbook .lastRow .class_hover {
background: #FF9900;
border-right: 2px dashed #FFFFFF;
color: #FFFFFF;
}
#textbook .row .chapter, #textbook .lastRow .chapter, #textbook .row .chapter a, #textbook .lastRow .chapter a, #textbook .row .nochapter, #textbook .lastRow .nochapter {
text-decoration: none;
width: 124px;
height: 19px;
margin-right: 2px;
color: #000000;
}
#textbook .row .chapter_hover, #textbook .lastRow .chapter_hover, #textbook .row .chapter_hover a, #textbook .lastRow .chapter_hover a {
background: #FF9900;
color: #FFFFFF;
}
How do I get div.class to expand to the full height of div.row and div.lastRow?