亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

仿XP的Tab標簽的JS代碼

系統 1923 0

整理過后的干凈的仿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 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.onclick=function()
{
tabbox.doclick(this.tabnum)
}
tbCell.onmouseover=function()
{

}
tbCell.onmouseout=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

仿XP的Tab標簽的JS代碼


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美大屁股精品毛片视频 | 99精品视频在线免费观看 | 久热久草 | 国产福利视频在线 | 欧美成人片在线 | 欧美日韩国产一区二区三区欧 | 97av免费视频 | 国产婷婷色综合成人精品 | 香蕉久久夜色精品国产小说 | 在线播放精品 | 夜色福利视频 | 欧美成人性色 | 国产成人久久精品一区二区三区 | 久久精品国产精品亚洲红杏 | 天天插天天干 | 精品久久久久久亚洲精品 | 青草香蕉精品视频在线观看 | 国产91在线九色 | 亚洲精品麻豆一区二区 | 国产毛片一区二区三区 | 国产亚洲精品九九久在线观看 | 国产第九页 | 天天操网站 | 亚洲精品αv一区二区三区 亚洲精品爱爱久久 | 免费一级成人毛片 | 三级不卡 | 99re这里只有热视频 | 国产精品v | 99爱免费 | 亚洲精品天堂一区二区三区 | 热热涩热热狠狠色香蕉综合 | 色久综合 | 91精品国产免费 | 日韩在线第三页 | 色综合网亚洲精品久久久 | 日本二区视频 | 国产真实偷人视频在线播放 | 欧美伦理一区 | 久久福利小视频 | 国产欧美一区视频在线观看 | 日本一级毛片不卡免费 |