欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JavaScript版TAB選項(xiàng)卡效果實(shí)例

 更新時(shí)間:2013年08月16日 16:43:51   作者:  
tab選項(xiàng)卡效果就是當(dāng)我指上或經(jīng)過時(shí)就會(huì)顯示這個(gè)選項(xiàng)卡下面的內(nèi)容,下面我來給大家介紹一款純js實(shí)現(xiàn)的TAB選項(xiàng)卡效果,有需要的朋友可以參考一下

復(fù)制代碼 代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript版TAB選項(xiàng)卡</title>
<script type="text/javascript">
function changeTab(id, minId, topCount)
        {
            for(var i=minId; i < minId+topCount; i++)
            {
                if( id == i)
                {
                    document.getElementById("li_" + i).className = "on";
                    document.getElementById("html_" + i).style.display = "block";     
                }
                else
                {
                    document.getElementById("li_" + i).className = "";
                    document.getElementById("html_" + i).style.display = "none";
                }
            }
        }
</script>
<style type="text/css">
.none{display:none;}
ul,li{list-style:none; margin:0; padding:0; font-size:12px;}
.tab{margin:100px;}
.tabTitle ul{overflow:hidden; zoom:1; border-left:1px solid #D5D3D4;}
.tabTitle li{width:82px; height:30px; line-height:30px; float:left; text-align:center; background:url(/2010/07/tab1.jpg) no-repeat;}
.tabTitle li.on{background:url(/uploads/2010/07/tab2.jpg) no-repeat;}
#html_1,#html_2,#html_3,#html_4,#html_5,#html_6{border:1px solid #D5D3D4; border-top:none; width:245px; height:100px;}
</style>
</head>
<body>

<div class="tab">
 <div class="tabTitle">
  <ul>
   <li id="li_1" class="on" onmouseover="changeTab(1, 1, 3);">本日熱門</li>
   <li id="li_2" onmouseover="changeTab(2, 1, 3);">本周熱門</li>
   <li id="li_3" onmouseover="changeTab(3, 1, 3);">本月熱門</li>
  </ul>
 </div>
 <div id="html_1">
  內(nèi)容1
 </div>
 <div id="html_2"  class="none">
  內(nèi)容2
 </div>
 <div id="html_3"  class="none">
  內(nèi)容3
 </div>
</div>
<div class="tab">
 <div class="tabTitle">
  <ul>
   <li id="li_4" class="on" onmouseover="changeTab(4, 4, 3);">本日推薦</li>
   <li id="li_5" onmouseover="changeTab(5, 4, 3);">本周推薦</li>
   <li id="li_6" onmouseover="changeTab(6, 4, 3);">本月推薦</li>
  </ul>
 </div>
 <div id="html_4">
  內(nèi)容1
 </div>
 <div id="html_5"  class="none">
  內(nèi)容2
 </div>
 <div id="html_6"  class="none">
  內(nèi)容3
 </div>
</div>
</body>
</html></td>
   </tr>
 </table>                   

相關(guān)文章

最新評(píng)論