• 全部
  • 问答

bread213 (隐客) : 改了height的代码,来取

wsj 2003-01-26 05:35:13
<HTML>
<HEAD>
<META content="text/html;charset=gb2312" http-equiv="Content-Type">
<script>
var Num=3; //这里是增加选项卡的数目
var carNum=2+Num;

function document.onselectstart() {
var obj=event.srcElement ;
if(obj.tagName=="SPAN") {
return false;
}
}

function document.onmousedown(){
var obj=event.srcElement;
var pobj=obj.parentElement.id;
if(obj.className=="span") {
for(i=1;i<carNum;i++) {
if(pobj==("btn"+i)) {
document.all("td"+i).style.backgroundColor="menu";
document.all("btn"+i).style.height=22;
content(i);
} else {
document.all("td"+i).style.backgroundColor="#FFFFFF";
document.all("btn"+i).style.height=18;
}
}
}
}

function content(i){
//这里是菜单名
mnuItem(1,"目录");
mnuItem(2,"索引");
mnuItem(3,"搜索");
mnuItem(4,"书签");
//End
if(i==1) {
span1.innerHTML="";
}
if(i==2) {
//span1.tree.innerHTML="<h2>索引<h2>";
}
if(i==3) {
//span1.tree.innerHTML="<h2>搜索</h2>";
}
if(i==4) {
//span1.tree.innerHTML="<h2>书签</h2>";
}
}

function mnuItem(i,con) {
document.all("MenuName"+i).innerText=con;
//document.all("MenuName"+i).innerHTML="<pre>" +con + "</pre>";
}

</script>
<style>
td{font-size:9pt}
.span{ cursor:default; padding-left:5; padding-top:2; padding-right:5; padding-bottom:0; width:40;height:100%; }
</style>
<TITLE></TITLE>
</HEAD>
<BODY onload=content(1) onselectstart="return false" bgcolor=menu >
<p>
<table width=0 onselectstart="return false" bgcolor=menu style="width:expression(document.body.offsetWidth);height:expression(document.body.offsetHeight);" >
<tr>
<td>
<table cellpadding=0 cellspacing=0 onselectstart="return false">
<tr height=30>
<td valign=bottom>
<table cellspacing=0 cellpadding=0 bgcolor=menu>
<tr>
<td width=1 height=1></td><td width=1 height=1></td>
<td bgcolor=white></td><td></td><td></td>
</tr>
<tr>
<td width=1 height=1></td><td width=1 height=1 bgcolor=white></td>
<td></td><td bgcolor=black></td><td></td>
</tr>
<tr>
<td width=1 bgcolor=white></td>
<td width=1 height=1></td>
<td id=btn1 height=22>
<span class=span id=MenuName1></span>
</td>
<td width=1 bgcolor=gray></td>
<td bgcolor=black width=1></td>
</tr>
<tr>
<td bgcolor=white></td>
<td colspan=4 height=1 bgcolor=menu id=td1></td>
</tr>
</table>
</td>
<td>
<script>
for(i=2;i<carNum;i++){
tdBody = "<td valign=bottom>";
tdBody += "<table cellspacing=0 cellpadding=0 bgcolor=menu>";
tdBody += "<tr>";
tdBody += "<td width=1 height=1><\/td><td width=1 height=1><\/td>";
tdBody += "<td bgcolor=white><\/td><td></td><td></td>";
tdBody += "<\/tr>";
tdBody += "<tr><td width=1 height=1><\/td><td width=1 height=1 bgcolor=white><\/td>";
tdBody += "<td></td><td bgcolor=black><\/td><td></td>";
tdBody += "<\/tr>";
tdBody += "<tr><td width=1 bgcolor=white><\/td><td width=1 height=1><\/td>";
tdBody += "<td id=btn"+i+" height=18><span class=span id=MenuName"+i+"> <\/span></td><td width=1 bgcolor=gray><\/td><td bgcolor=black width=1><\/td>";
tdBody += "<\/tr>";
tdBody += "<tr><td bgcolor=white><\/td><td colspan=4 height=1 bgcolor=white id=td"+i+"><\/td>";
tdBody += "<\/tr>";
tdBody += "<\/table>";
tdBody += "<\/td>";
document.write(tdBody);
}
</script>
</td>
<td style="BORDER-BOTTOM: white 1px solid" width=50
></td>
</tr>
</table>
<div style="padding:10;width:100%;height:90%;border-left:1 white solid;border-right:2 outset;border-bottom:2 outset">
<span id=span1></span><!--这里是内容-->
</div>
</td>
</tr>
</table></p>
</BODY>
</HTML>

PS.这个 Tab 程序在哪里得的?好差,都没法改
...全文
12 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
bread213 2003-01-26
收到
回复
发帖
JavaScript
创建于2007-09-28

8.5w+

社区成员

Web 开发 JavaScript
申请成为版主
帖子事件
创建了帖子
2003-01-26 05:35
社区公告
暂无公告