多DIV重叠
1.
<div id="left_bot_list1" style="height:448px;width:228px;overflow:auto">
</div>
<div id="left_bot_list2" style="VISIBILITY:hidden;POSITION: relative;Top:expression(0-document.getElementById('left_bot_list1').offsetHeight);">
</div>
<div id="left_bot_list3" style="VISIBILITY:hidden;POSITION: relative;Top:expression(0-document.getElementById('left_bot_list1').offsetHeight-document.getElementById('left_bot_list2').offsetHeight);">
</div>
<script type="text/javascript" language="Javascript">
function changeDivleft_bot(num){
if(num == 1){
left_bot_list1.style.visibility = "visible";
left_bot_list2.style.visibility = "hidden";
left_bot_list3.style.visibility = "hidden";
}
if(num == 2){
left_bot_list1.style.visibility = "hidden";
left_bot_list2.style.visibility = "visible";
left_bot_list3.style.visibility = "hidden";
}
if(num == 3){
left_bot_list1.style.visibility = "hidden";
left_bot_list2.style.visibility = "hidden";
left_bot_list3.style.visibility = "visible";
}
}
//alert(tree.loaded);
</script>
2.
<div id="left_bot_list1" style="display:inline;height:448px;width:222px;overflow:auto">
</div>
<div id="left_bot_list2" style="display:none;height:448px;width:222px;overflow:auto">
</div>
<div id="left_bot_list3" style="display:none;height:448px;width:222px;overflow:auto" >
</div>
<script type="text/javascript" language="Javascript">
function changeDivleft_bot(num){
if(num == 1){
left_bot_list1.style.display = 'inline';
left_bot_list2.style.display = 'none';
left_bot_list3.style.display = 'none';
}
if(num == 2){
left_bot_list1.style.display = 'none';
left_bot_list2.style.display = 'inline';
left_bot_list3.style.display = 'none';
}
if(num == 3){
left_bot_list1.style.display = 'none';
left_bot_list2.style.display = 'none';
left_bot_list3.style.display = 'inline';
}
}
</script>
注意:此写法有一个问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
若页面头部有以上这句话则无法实现滚动条的功能,不知道为什么.
发表于 @ 2008年12月18日 11:24:00 | 评论( loading... ) | 举报| 收藏