背景:#EDF0F5 #FAFBE6 #FFF2E2 #FDE6E0 #F3FFE1 #DAFAF3 #EAEAEF 默认  
阅读新闻

选项卡效果脚本

[日期:2007-08-22] 来源:  作者: [字体: ]
目前网上用的很多的选项卡效果,点击下边代码查看效果
你可以在iwms结合TopList函数与ImgTopList函数实现多种效果
要实现鼠标感应切换把代码中onclick换为onmouseover

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--<link href="1.css" rel="stylesheet" type="text/css">-->
<script language="JavaScript">
function tabit(id,cid) {
tabwoman.className="taboff";tabman.className="taboff";tabsport.className="taboff";tableisure.className="taboff";tabshoes.className="taboff";tabdecor.className="taboff";id.className="tabon";
cwoman.style.display="none";cman.style.display="none";csport.style.display="none";cleisure.style.display="none";cshoes.style.display="none";cdecor.style.display="none";cid.style.display="block";
//winname=cid;
}


function showall() {
tabwoman.className="tabon";tabman.className="tabon";tabsport.className="tabon";tableisure.className="tabon";tabshoes.className="tabon";tabdecor.className="tabon";
cwoman.style.display="block";cman.style.display="block";csport.style.display="block";cleisure.style.display="block";cshoes.style.display="block";cdecor.style.display="block";
}
</script>
<style>
td {
 font-family: "Verdana";
 font-size: 9pt;
 padding:3px;
}

.tabon {
 background-color: #ffffff;
 border-top: 1px solid #e3e3e3;border-left: 1px solid #e3e3e3;
 color: #DB5B6F;
 font-weight: bold;
}

.taboff {
 background-color: #f5f5f5;
 border-top: 1px solid #e3e3e3;border-left: 1px solid #e3e3e3;border-bottom: 1px solid #e3e3e3;
 color: #666666;
 font-weight: bold;
}

.tdbody {
 border-bottom: 1px solid #e3e3e3;border-right: 1px solid #e3e3e3;border-left: 1px solid #e3e3e3;
 line-height:50px;
 background-color: #ffffff;
}

.tdbody2 {
 border-right: 1px solid #e3e3e3;border-left: 1px solid #e3e3e3;
 line-height:50px;
 background-color: #ffffff;
}
</style>
</head>

<body onLoad="tabit(tabwoman,cwoman)">

<table border="0" cellpadding="0" cellspacing="0" width="340">
  <tr>
    <td class="taboff" id="tabwoman" style="cursor:hand" onClick="tabit(tabwoman,cwoman)" align="center">女装</td>
    <td class="taboff" id="tabman" style="cursor:hand" onClick="tabit(tabman,cman)" align="center">男装</td>
    <td class="taboff" id="tabsport" style="cursor:hand" onClick="tabit(tabsport,csport)" align="center">运动</td>
    <td class="taboff" id="tableisure" style="cursor:hand" onClick="tabit(tableisure,cleisure)" align="center">休闲</td>
    <td class="taboff" id="tabshoes" style="cursor:hand" onClick="tabit(tabshoes,cshoes)" align="center">鞋类</td>
    <td class="taboff" id="tabdecor" style="cursor:hand" onClick="tabit(tabdecor,cdecor)" align="center" style="border-right: 1px solid #E3E3E3">配饰</td>
  </tr>
  <tr id="cwoman" style="display:none">
    <td colspan="6" class="tdbody"><a href="#">女装</a></td>
  </tr>
  <tr id="cman" style="display:none">
    <td colspan="6" class="tdbody"><a href="#">男装</a></td>
  </tr>
  <tr id="csport" style="display:none">
    <td colspan="6" class="tdbody"><a href="#">运动</a></td>
  </tr>
  <tr id="cleisure" style="display:none">
    <td colspan="6" class="tdbody"><a href="#">休闲</a></td>
  </tr>
  <tr id="cshoes" style="display:none">
    <td colspan="6" class="tdbody"><a href="#">鞋类</a></td>
  </tr>
  <tr id="cdecor" style="display:none">
    <td colspan="6" class="tdbody"><a href="#">配饰</a></td>
  </tr>
</table>

阅读:
录入:木鸟

推荐 】 【 打印
上一篇:获取真实页面,窗口高度与宽度函数
下一篇:IE和Firefox的js兼容性整理
相关新闻      
本文评论       全部评论
  选项卡减少后错处。另外能否修改成div-css   (huam ,2007-11-28 )
  请问:这个样式表是在整个网页中只能使用一次,还是可以重复调用,比如看网易的首页,使用   (卢顺成 ,2007-10-06 )
  最好是鼠标停上面就发生变化! --- 改onClick为onMouseOver   (rt9 ,2007-08-22 )
发表评论


点评: 字数
姓名:

  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款