仿XP的Tab标签的JS代码

整理过后的干净的仿XP的Tab标签代码。



点击下载源文件


tab.htm 文件内容如下:
<script src="common/tabclass.js"></script>
<link href="common/style.css" rel="stylesheet" type="text/css">
<script>
var tabbox1=new TabBox("tab1")
tabbox1.addtab("p1","留言",0)
tabbox1.addtab("p2","附件")
tabbox1.addtab("p3","关于此控件")
</script>

<body bgcolor="#AEAEAE">
<table border="0" style="border-collapse: collapse" bordercolor="#808080" cellpadding="0" >
 <tr><td>
 <script>
  tabbox1.init()
 </script>
 </td>
 </tr>
 <tr width="300"><td bgcolor="#FFFFFF" style="border:1px #000000 solid;border-top:none" nowrap>
 <table id=p1><tr><td>
  <textarea rows="6" name="S1" cols="51"></textarea></td></tr></table>
 <table id=p2><tr><td><input type=file ></td></tr></table>
    <table id=p3><tr><td>此控件由<b><font face="Verdana"><font color="#FF0000">puter</font>jam</font></b>独立开发<br>如果你在使用过程中有什么意见和建议,请到 <a href="http://puterjam.vipx.net/" target=_blank>puterjam.vipx.net</a> </td></tr></table>
 </td></tr>
 <script>tabbox1.inithidetab()</script>
 </table>
</body>


common/tabclass.js文件内容如下:

function TabBox(tabname,type){
var tabbox=this;
this.tabname=tabname;
this.lasttab=1;
this.tabarray=new Array()
this.tabPad=null;

//----保存tab项目数祖----
this.item=function(tabid,caption,dis){
   this.tabid=tabid
   this.caption=caption
   this.dis=dis
}

//----添加tab项目----
this.addtab=function(tabid,caption,dis){
 //alert(tabbox.tabarray.length)
 tabbox.tabarray[tabbox.tabarray.length]=new tabbox.item(tabid,caption,dis)
}

//--程序初试化----
this.init=function(){
 //alert(tabbox.tabname)
 if (tabbox.tabarray.length==0) {alert("没有任何项目");return}
 document.write("<div id='"+tabbox.tabname+"div'>")
 tabbox.tabPad=eval("document.all."+tabbox.tabname+"div")
  var tbBoard=document.createElement("table")
 tabbox.tabPad.insertAdjacentElement("beforeEnd",tbBoard);
 tbBoard.style.cssText="border-collapse: collapse"
 tbBoard.border="0"
 tbBoard.cellSpacing="0"
 tbBoard.cellPadding="0"
 tbBoard.height="24"
 tbBoard.width="100%"
 trRow = tbBoard.insertRow(0)
 trRow.height="3"
 
 var tl=0
 tbCell=trRow.insertCell(tl)
 tbCell.id=tabbox.tabname+'_tabbar1'
 tbCell.rowSpan="2"
 tbCell.className="tbottom3"
 tbCell.width="3"
 tbCell.noWrap=true
 
 tl++
 tbCell=trRow.insertCell(tl)
 tbCell.id=tabbox.tabname+'_tabtop1'
 tbCell.noWrap=true
 
 for (i=1;i<tabbox.tabarray.length;i++)
   {
    tl++
    tbCell=trRow.insertCell(tl)
    tbCell.id=tabbox.tabname+'_tabbar'+(i+1)
    tbCell.rowSpan="2"
    tbCell.className="tbottom"
    tbCell.width="3"
    tbCell.noWrap=true
  
    tl++
    tbCell=trRow.insertCell(tl)
    tbCell.id=tabbox.tabname+'_tabtop'+(i+1)
    tbCell.noWrap=true
   }
  
 tl++
 tbCell=trRow.insertCell(tl)
 tbCell.id=tabbox.tabname+'_tabbar'+(tabbox.tabarray.length+1)
 tbCell.rowSpan="2"
 tbCell.className="tbottom2"
 tbCell.width="3"
 tbCell.noWrap=true
 
 tl++
 tbCell=trRow.insertCell(tl)
 tbCell.rowSpan="2" 
 tbCell.width="100%"
 tbCell.noWrap=true
 tbCell.style.cssText="border-bottom:1px #000000 solid;"
 //alert(tbBoard.cells.length)
  trRow = tbBoard.insertRow(1)
   for (i=0;i<tabbox.tabarray.length;i++)
   {

     tbCell=trRow.insertCell(i)
     tbCell.id=tabbox.tabname+'_tabcon'+(i+1)
     tbCell.className="lostfouce"
     if (tabbox.tabarray[i].dis==1)
        {
          tbCell.innerHTML="<b>"+tabbox.tabarray[i].caption+"&nbsp;"+"</b>"
        }
        else
        {
          tbCell.innerHTML=tabbox.tabarray[i].caption+"&nbsp;"
        }
     tbCell.tabnum=i+1
     tbCell.noWrap=true
     tbCell.οnclick=function()
     {
       tabbox.doclick(this.tabnum)
     }
     tbCell.οnmοuseοver=function()
     {
     
     }
     tbCell.οnmοuseοut=function()
     {
     tabbox.doout(this)
     }
   }
 
}

this.inithidetab=function(num)
{

  for (i=0;i<tabbox.tabarray.length;i++)
   {
      eval(tabbox.tabarray[i].tabid).style.display="none"
   }
   tabbox.doclick(1)
}
this.doclick=function(num,action){
lastbar1=eval(tabbox.tabname+"_tabbar"+this.lasttab)
nlasttab=this.lasttab+1
lastbar2=eval(tabbox.tabname+"_tabbar"+nlasttab)

tpbar1=eval(tabbox.tabname+"_tabbar"+1)
tpbar2=eval(tabbox.tabname+"_tabbar"+(tabbox.tabarray.length+1))

tabtop=eval(tabbox.tabname+"_tabtop"+this.lasttab)
tabcon=eval(tabbox.tabname+"_tabcon"+this.lasttab)
tabtop.className=""
tabcon.className="lostfouce"
//alert(lastbar2.className)
   lastbar1.className='tbottom';
   lastbar2.className='tbottom';
   tpbar1.className='tbottom3';
   tpbar2.className='tbottom2';
eval(tabbox.tabarray[this.lasttab-1].tabid).style.display="none"
 
lastbar1=eval(tabbox.tabname+"_tabbar"+num)
nnum=num+1
lastbar2=eval(tabbox.tabname+"_tabbar"+nnum)
tabtop=eval(tabbox.tabname+"_tabtop"+num)
tabcon=eval(tabbox.tabname+"_tabcon"+num)
   lastbar1.className='tleft';
   lastbar2.className='tright';   
   tabtop.className="ttop"
   tabcon.className="getfouce"
  //alert(tabbox.tabarray[num-1].tabid)
eval(tabbox.tabarray[num-1].tabid).style.display="block"

 this.lasttab=num;
}


this.doover=function(obj){
if (obj.className=="lostfouce")
  {
   obj.className="lostfouce_over"
     }

}

this.doout=function(obj){
if (obj.className=="lostfouce_over")
  {
   obj.className="lostfouce"
     }

}
}


common/style.css文件内容如下:


body
{
 margin: 6pt;
s}

td
{
 font-family: 宋体;
 font-size: 12px;
 color: #000000;
}

.bd
{
 FILTER: progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#999999,strength=3);
}
.tleft
{
 background-image: url('../img/tab1.gif');
}
.tright
{
 background-image: url('../img/tab3.gif');
}
.ttop
{
 background-image: url('../img/tab2.gif');
}
.ttop_over
{
 background-image: url('../img/tab8.gif');
}
.tbottom
{
 background-image: url('../img/tab4.gif');
}
.tbottom2
{
 background-image: url('../img/tab6.gif');
}
.tbottom3
{
 background-image: url('../img/tab7.gif');
 border-bottom: 1px #000000 solid;
}
.getfouce
{
 cursor: default;
 text-indent: 6px;
 font-size: 12px;
 background-color: #ffffff;
 color:#000000;
 FONT-FAMILY: "宋体";
 font-weight:bold
}
.lostfouce
{
 text-indent: 6px;
 font-size: 12px;
 background-image: url('../img/tab5.gif');
 border-bottom: 1px #000000 solid;
 cursor: hand;
 color:#555555;
 FONT-FAMILY: "宋体";
 padding-top:4px
}
.lostfouce_over
{
 text-indent: 6px;
 font-size: 12px;
 cursor: hand;
 background-image: url('../img/tab9.gif');
 border-bottom: 1px #000000 solid;
}



http://www.imting.com/puterjam/blogview.asp?logID=49&cateID=1

资源下载链接为: https://pan.quark.cn/s/d0b0340d5318 Cartopy安装所需包分为两个部分,分别需要下载。以下是下载链接和建议的操作步骤: Cartopy安装所需包2:Cartopy安装所需包2.rar 安装教程:Cartopy安装教程之pip篇 下载文件: 首先,分别下载上述两个链接中的文件。第一个链接包含了Cartopy安装所需的包(部分),第二个链接是详细的安装教程。 建议将下载的文件解压后,统一放在一个路径下,例如命名为“Cartopy安装文件”的文件夹,方便后续操作。 参考安装教程: 安装教程详细介绍了通过pip安装Cartopy的步骤,包括环境变量设置、下载必要安装包、安装过程以及测试。 根据教程,需要安装的依赖包包括numpy、pyshp、Shapely、pyproj、Pillow等,教程中还提供了针对Windows系统的预编译版本下载链接。 安装过程中可能会遇到缺少pykdtree和scipy模块的情况,教程也提供了相应的解决方法。 安装注意事项: 确保Python环境变量已正确设置,可通过命令行输入python --version来验证。 安装Wheel工具,用于安装.whl文件。 按照教程中的命令依次安装各个依赖包,注意版本号需与Python版本匹配。 如果遇到缺少模块的错误,按照教程中的方法进行安装。 通过以上步骤,可以顺利完成Cartopy的安装。如果在安装过程中遇到问题,可以参考安装教程中的详细说明或在相关社区寻求帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值