廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 3408 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
toidi
個人頭像
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x0 鮮花 x17
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[JScript][討論] Tab 分頁
簡單的分頁效果
簡捷有力 !!

複製程式
<html>
<head>
<!-- 請將下列程式碼輸入在 <head></head> 之間 -->
<style>
.conts{visibility:hidden}
.tab{border-top:solid thin #E0E0E0;
border-right:solid thin gray;
border-left:solid thin #E0E0E0;
font-family:Verdana;
font-size:09pt;
text-align:center;
font-weight:normal}
.selTab{border-left:solid thin white;
border-top:solid thin white;
border-right:solid thin black;
font-weight:normal;
text-align:center}
</style>
<script LANGUAGE="JavaScript">
function public_Labels(label1, label2, label3, label4, label5, label6, label7, label8){
t1.innerText = label1;
t2.innerText = label2;
t3.innerText = label3;
t4.innerText = label4;
t5.innerText = label5;
t6.innerText = label6;
t7.innerText = label7;
t8.innerText = label8;
}
//a public function that the container uses to pass in values for the card containers
function public_Contents(contents1, contents2, contents3, contents4, contents5, contents6, contents7, content8){
t1Contents.innerHTML = contents1;
t2Contents.innerHTML = contents2;
t3Contents.innerHTML = contents3;
t4Contents.innerHTML = contents4;
t5Contents.innerHTML = contents5;
t6Contents.innerHTML = contents6;
t7Contents.innerHTML = contents7;
t8Contents.innerHTML = contents8;
init();
}
//sets the default display to tab 1
function init(){
tabContents.innerHTML = t1Contents.innerHTML;
}
//this is the tab switching function
var currentTab;
var tabBase;
var firstFlag = true;
function changeTabs(){
if(firstFlag == true){
currentTab = t1;
tabBase = t1base;
firstFlag = false;
}
if(window.event.srcElement.className == "tab"){
currentTab.className = "tab";
tabBase.style.backgroundColor = "White";
currentTab = window.event.srcElement;
tabBaseID = currentTab.id + "base";
tabContentID = currentTab.id + "Contents";
tabBase = document.all(tabBaseID);
tabContent = document.all(tabContentID);
currentTab.className = "selTab";
tabBase.style.backgroundColor = "";
tabContents.innerHTML = tabContent.innerHTML;
}}</script>
<style>
.conts  {visibility:hidden}
.tab{border-top:solid thin #E0E0E0;
border-right:solid thin gray;
border-left:solid thin #E0E0E0;
font-family:Verdana;
font-size:09pt;
text-align:center;
font-weight:normal}
.selTab{border-left:solid thin white;
border-top:solid thin white;
border-right:solid thin black;
font-weight:normal;
text-align:center}
</style>
</head>


<body>
<!--將以下代碼加入HTML的<BODY></BODY>之間-->
<body BGCOLOR="#c0c0c0" onclick="changeTabs()" onload="init()">
<div STYLE="position:absolute; top:20; height:350; width:500; left:65; border:none thin gray">
<table STYLE="width:600; height:350" CELLPADDING="0" CELLSPACING="0" bgcolor="c0c0c0">
<tr><td ID="t1" CLASS="selTab" HEIGHT="25">選項 1</td>
<td ID="t2" CLASS="tab">選項 2</td>
<td ID="t3" CLASS="tab">選項 3</td>
<td ID="t4" CLASS="tab">選項 4</td>
<td ID="t5" CLASS="tab">選項 5</td>
<td ID="t6" CLASS="tab">選項 6</td>
<td ID="t7" CLASS="tab">選項 7</td>
<td ID="t8" CLASS="tab">選項 8</td>
</tr><tr>
<td ID="t1base" STYLE="height:2; border-left:solid thin white"></td>
<td ID="t2base" STYLE="height:2; background-color:white"></td>
<td ID="t3base" STYLE="height:2; background-color:white"></td>
<td ID="t4base" STYLE="height:2; background-color:white"></td>
<td ID="t5base" STYLE="height:2; background-color:white"></td>
<td ID="t6base" STYLE="height:2; background-color:white"></td>
<td ID="t7base" STYLE="height:2; background-color:white"></td> 
<td ID="t8base" STYLE="height:2; background-color:white; border-right:solid thin white"></td>
</tr><tr><td HEIGHT="*" COLSPAN="8" ID="tabContents"
STYLE="border-left:solid thin white;border-bottom:solid thin white;border-right:solid thin white">sample 
contents</td></tr></table></div><div CLASS="conts" ID="t1Contents">
<p align="center">Tab1的內容 <br><iframe src=./slicePic.htm width=600></iframe></p>
</div><div CLASS="conts" ID="t2Contents">
<p align="center">Tab2的內容 </p>
</div><div CLASS="conts" ID="t3Contents">
<p align="center">Tab3的內容 </p>
</div><div CLASS="conts" ID="t4Contents">
<p align="center">Tab4的內容 </p>
</div><div CLASS="conts" ID="t5Contents">
<p align="center">Tab5的內容 </p>
</div><div CLASS="conts" ID="t6Contents">
<p align="center">Tab6的內容 </p>
</div><div CLASS="conts" ID="t7Contents"><p align="center">Tab7的內容 </p>
</div><div CLASS="conts" ID="t8Contents"><p align="center">Tab8的內容<hr>
<img src=http://163.22.51.15/run.gif><br><img src=http://163.22.51.15/run.gif><br><img src=http://163.22.51.15/run.gif><br> </p></div>

</body>
</html>



-=FiS=-
_/_/_/_/_/施比受更有福_/_/_/_/_/
獻花 x0 回到頂端 [樓 主] From:局域網對方和您在同一內部網 | Posted:2005-11-09 16:41 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.020077 second(s),query:15 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言