一个很简单的JS实现的选项卡
2008-12-18 15:05
197 查看
<style>
.titles{
font-size:14px;
color:#07519a;
border-top:#d3d3d3 1px solid;
border-bottom:#d3d3d3 1px solid;
border-left:#d3d3d3 1px solid;
border-right:#d3d3d3 1px solid;
}
.contents
{
text-align=center;
font-size:12px;
height:240px;
border-bottom:#d3d3d3 1px solid;
border-left:#d3d3d3 1px solid;
border-right:#d3d3d3 1px solid;
}
</style>
<script>
function ShowLayers(n,m)
{
for(i=1;i<=m;i++)
{
eval("content" + i).style.display="none";
eval("title"+i+".style.color=/"07519a/";");
eval("title"+i+".style.background=/"ffffff/";");
}
eval("title"+n+".style.background=/"eaedfc/";");
eval("title"+n+".style.color=/"red/";");
eval("content" + n).style.display="";
}
</script>
<table width="808" border="0" cellpadding="0" cellspacing="0" bgcolor="ffffff">
<tr>
<td height="25" width="93px" class="titles" id="title1"
bgcolor="#eaedfc" style="color:red" align="center">
<a onmouseover="javascript:ShowLayers(1,3);">标题一</a></td>
<td height="25" width="93px" class="titles" id="title2"
align="center">
<a onmouseover="javascript:ShowLayers(2,3);">标题二</a></td>
<td height="25" width="93px" class="titles" id="title3"
align="center">
<a onmouseover="javascript:ShowLayers(3,3);">标题三</a></td>
<td width=529px height=25px class="titles" align="right" style="font-size:12px;">
>>更多 </td>
</tr>
<tr>
<td height="240" colspan="5" bgcolor="ffffff">
<div id="content1" style="display:;" class="contents">
内容1
</div>
<div id="content2" style="display:none;" class="contents">
内容2
</div>
<div id="content3" style="display:none;" class="contents">
内容3
</div>
</td>
</tr>
</table>
.titles{
font-size:14px;
color:#07519a;
border-top:#d3d3d3 1px solid;
border-bottom:#d3d3d3 1px solid;
border-left:#d3d3d3 1px solid;
border-right:#d3d3d3 1px solid;
}
.contents
{
text-align=center;
font-size:12px;
height:240px;
border-bottom:#d3d3d3 1px solid;
border-left:#d3d3d3 1px solid;
border-right:#d3d3d3 1px solid;
}
</style>
<script>
function ShowLayers(n,m)
{
for(i=1;i<=m;i++)
{
eval("content" + i).style.display="none";
eval("title"+i+".style.color=/"07519a/";");
eval("title"+i+".style.background=/"ffffff/";");
}
eval("title"+n+".style.background=/"eaedfc/";");
eval("title"+n+".style.color=/"red/";");
eval("content" + n).style.display="";
}
</script>
<table width="808" border="0" cellpadding="0" cellspacing="0" bgcolor="ffffff">
<tr>
<td height="25" width="93px" class="titles" id="title1"
bgcolor="#eaedfc" style="color:red" align="center">
<a onmouseover="javascript:ShowLayers(1,3);">标题一</a></td>
<td height="25" width="93px" class="titles" id="title2"
align="center">
<a onmouseover="javascript:ShowLayers(2,3);">标题二</a></td>
<td height="25" width="93px" class="titles" id="title3"
align="center">
<a onmouseover="javascript:ShowLayers(3,3);">标题三</a></td>
<td width=529px height=25px class="titles" align="right" style="font-size:12px;">
>>更多 </td>
</tr>
<tr>
<td height="240" colspan="5" bgcolor="ffffff">
<div id="content1" style="display:;" class="contents">
内容1
</div>
<div id="content2" style="display:none;" class="contents">
内容2
</div>
<div id="content3" style="display:none;" class="contents">
内容3
</div>
</td>
</tr>
</table>
相关文章推荐
- [js插件开发教程]实现一个比较完整的开源级选项卡插件
- JS实现同一个网页布局滑动门和TAB选项卡实例
- JS实现同一个网页布局滑动门和TAB选项卡实例
- 每日一个js实例7--通过面向对象实现选项卡
- js实现获取当前月份前的12个月份,格式化后放在一个数组里。
- JS实现一个按钮的方法
- 用户进入一个工程的PC端和手机端选择的js实现
- JS将滑动门改为选项卡(需鼠标点击)的实现方法
- js实现简单的可切换选项卡效果
- 利用Node.js的Net模块实现一个命令行多人聊天室
- 头像上传剪裁预览功能js实现,以及Safari中一个坑。
- HTML5+JS 《五子飞》游戏实现(四)夹一个和挑一对
- 链地址法实现一个很简单的hash表
- 用json方式实现在 js 中建立一个map
- 一个用js实现的页内搜索代码
- JS实现Tab选项卡
- javascript 原生JS实现 选项卡的切换(两种方法)
- js实现的Easy Tabs选项卡用法实例
- js实现datagrid 模板列中有多个checkbox 时只许选中一个..........