zoukankan      html  css  js  c++  java
  • tab切换

    利用bootstrap的nav类名加上jquery点击事件进行切换

    html部分

    首先引入bootstrap.css文件;

    <div class="tabBox">
    <ul class="nav nav-tabs" id="myTab">
    <li class="active"><a href="#home">基本信息</a></li>
    <li><a href="#profile">管理参数</a></li>
    <li><a href="#messages">资源状态</a></li>
    <li><a href="#settings">高频头状态</a></li>
    </ul>
    </div>
    <div class="tab-content">
    <div class="tab-pane active" id="home">
    <table class="table table-bordered">
    <thead>
    <tr>
    <th>参数名称</th>
    <th>类型</th>
    <th>参数描述</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>Device.DeviceInfo.DeviceSummary</td>
    <td>string(1024)</td>
    <td>设备描述及静态配置</td>
    </tr>
    <tr>
    <td>Device.DeviceInfo.Manufacturer</td>
    <td>string(64)</td>
    <td>设备制造商</td>
    </tr>
    <tr>
    <td>Device.DeviceInfo.ManufacturerOUI</td>
    <td>string(6)</td>
    <td>制造商OUI</td>
    </tr>
    </tbody>
    </table>
    </div>
    <div class="tab-pane" id="profile">
    <table class="table table-bordered">
    <thead>
    <tr>
    <th>参数名称</th>
    <th>类型</th>
    <th>参数描述</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>Device.ManagementServer.URL</td>
    <td>string(256)</td>
    <td>STB连接TMS的URL</td>
    </tr>
    <tr>
    <td>Device.ManagementServer.ID</td>
    <td>string(256)</td>
    <td>STB连接TMS使用的认证ID</td>
    </tr>
    <tr>
    <td>Device.ManagementServer.ConnectionRequestURL</td>
    <td>string(256)</td>
    <td>TMS向STB发出请求通知的URL</td>
    </tr>
    </tbody>
    </table>
    </div>
    <div class="tab-pane" id="messages">
    <table class="table table-bordered">
    <thead>
    <tr>
    <th>参数名称</th>
    <th>类型</th>
    <th>参数描述</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>Device.TMS.SystemStatus.RAMRest</td>
    <td>UnsignedInt</td>
    <td>可用RAM空间</td>
    </tr>
    <tr>
    <td>Device.TMS.SystemStatus.FlashRest</td>
    <td>UnsignedInt</td>
    <td>可用Flash空间</td>
    </tr>
    <tr>
    <td>Device.TMS.SystemStatus.SystemRunTime</td>
    <td>UnsignedInt</td>
    <td>系统运行时间</td>
    </tr>
    </tbody>
    </table>
    </div>
    <div class="tab-pane" id="settings">
    <table class="table table-bordered">
    <thead>
    <tr>
    <th>参数名称</th>
    <th>类型</th>
    <th>参数描述</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>Device.TMS.HardwareStatus.Tuner.Count</td>
    <td>UnsignedInt</td>
    <td>高频头数量</td>
    </tr>
    <tr>
    <td>Device.TMS.HardwareStatus.Tuner.{i}.CurrentFrequency</td>
    <td>UnsignedInt</td>
    <td>当前频点</td>
    </tr>
    <tr>
    <td>Device.TMS.HardwareStatus.Tuner.{i}.Modulation</td>
    <td>String(8)</td>
    <td>调制方式</td>
    </tr>
    </tbody>
    </table>
    </div>
    </div>
    script部分
    首先引入jquery.min.js文件,然后引入bootstrap.min.js文件。
    //tab栏切换
    $(function () { //设置默认显示
    $('#myTab a:first').tab('show');
    })
    $('#myTab a').on("click",function (e) {
    e.preventDefault();
    $(this).tab('show');
    })
    简单切换效果如下:

  • 相关阅读:
    zz[读书笔记]《Interpretable Machine Learning》
    Xgboost,LightGBM 和 CatBoost
    zz:Xgboost 导读和实战
    bzoj3252: 攻略 优先队列 并查集 贪心
    [BeiJing2009 WinterCamp]取石子游戏 Nim SG 函数
    Playing With Stones UVALive
    Division Game UVA
    [BJWC2011]禁忌 AC 自动机 概率与期望
    [Jsoi2010]连通数 bitset + Floyd
    洛谷P2197 nim游戏模板
  • 原文地址:https://www.cnblogs.com/lingdu87/p/7890380.html
Copyright © 2011-2022 走看看