zoukankan      html  css  js  c++  java
  • 普通版选项卡

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
    *{
    padding:0;
    margin:0;
    list-style: none;
    }
    #box1{
    500px;
    height:500px;
    border:1px solid red;
    }
    #box1 input{
    background: yellow;
    }
    #box1 .active{
    background: red;
    }
    #box1 div{
    300px;
    height:300px;
    background: red;
    font-size: 50px;
    text-align: center;
    line-height: 300px;
    display: none;
    }
    #box1 .show{
    display: block;
    }
    </style>
    </head>
    <body>
    <div id="box1">
    <input type="button" value="按钮1" class="active">
    <input type="button" value="按钮2">
    <input type="button" value="按钮3">
    <div class="show">1</div>
    <div>2</div>
    <div>3</div>
    </div>
    <script>
    var oBox = document.getElementById('box1');
    var aBtn = oBox.getElementsByTagName('input');
    var aBox = oBox.getElementsByTagName('div');
    for(var i=0; i<aBtn.length; i++){
    aBtn[i].index = i;
    aBtn[i].onclick = function () {
    for(var i=0; i<aBtn.length; i++){
    aBtn[i].className = '';
    aBox[i].className = '';
    }
    aBox[this.index].className = 'show';
    this.className = 'active';
    }
    }
    </script>
    </body>
    </html>
  • 相关阅读:
    (十一)设置关闭多核cpu的核
    (十)修改开发板主频
    (九)How to use the audio gadget driver
    (8)全志A64查看寄存器
    内存溢出问题配置
    百度数据库优化经验
    如何让sql运行的更快
    百度性能优化
    spring ioc原理
    JNDI
  • 原文地址:https://www.cnblogs.com/qiudongjie/p/6602712.html
Copyright © 2011-2022 走看看