国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

js選項卡的制作方法

2019-11-19 17:48:29
字體:
來源:轉載
供稿:網友

本文實例為大家分享了js選項卡的具體代碼,供大家參考,具體內容如下

<!doctype html><html lang="en">  <head>   <meta charset="UTF-8">   <title>選項卡</title>  </head>  <style>    /*復位*/  *{padding:0;margin:0;}    div#tabs{      width:600px;      height:400px;      margin:100px auto;      position:relative;    }    .tab{      width:100px;      height:50px;      position:absolute;      top:0;    }    input.tab{      z-index:11;      opacity:0;      cursor:pointer;    }    a.tab{       z-index:10;       text-align:center;       line-height:50px;       text-decoration:none;       color:black;       font-size:30px;    }    .tab1{      left:0px;    }    .tab2{      left:100px;    }    .tab3{      left:200px;    }    /*鼠標滑過*/    input.tab:hover+a{     background-color:#ccc;    }    /*鼠標點擊*/    input.tab:checked+a{      border:1px solid #ccc;      border-bottom:none;      background-color:white;    }        /*scroll設置*/    div#scroll{      position:absolute;      top:50px;      width:100%;      height:350px;      border:1px solid #ccc;      overflow:hidden;    }    div#scroll>div.content{      width:100%;      height:100%;      position:absolute;      top:0;      left:100%;      padding:15px;      transition:all 0.6s linear;    }    input.tab1:checked~div#scroll>div.content1,    input.tab2:checked~div#scroll>div.content2,    input.tab3:checked~div#scroll>div.content3{      left:0%;    }  </style> <body>  <div id="tabs">   <input type="radio" name="tab" class="tab tab1" checked />   <a href="#" class="tab tab1">選項一</a>   <input type="radio" name="tab" class="tab tab2"/>   <a href="#" class="tab tab2">選項二</a>   <input type="radio" name="tab" class="tab tab3"/>   <a href="#" class="tab tab3">選項三</a>   <div id="scroll">     <div class="content content1">      哈哈111<br/>      哈哈111<br/>      哈哈111<br/>      哈哈111<br/>      哈哈111<br/>     </div>     <div class="content content2">      哈哈222<br/>      哈哈222<br/>      哈哈222<br/>      哈哈222<br/>      哈哈222<br/>     </div>     <div class="content content3">      哈哈333<br/>      哈哈333<br/>      哈哈333<br/>      哈哈333<br/>      哈哈333<br/>     </div>    </div>  </div> </body></html>

效果圖:

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 永善县| 郧西县| 许昌县| 怀安县| 巴中市| 泗水县| 霍林郭勒市| 莎车县| 资溪县| 铁岭市| 武穴市| 乡城县| 酉阳| 左云县| 绩溪县| 三门县| 永吉县| 康马县| 炎陵县| 尤溪县| 黑山县| 嘉峪关市| 民丰县| 利津县| 玛曲县| 偃师市| 呈贡县| 赣榆县| 济宁市| 贵州省| 夏邑县| 雷波县| 凤庆县| 德庆县| 周宁县| 泰来县| 罗源县| 靖安县| 绥江县| 应城市| 信宜市|