zoukankan      html  css  js  c++  java
  • 多个选项卡切换

    <div class="wrap2top">
                        <div class="nTab">
                            <div class="TabTitle">
                                <ul id="myTab1">
                                    <li class="current" onclick="nTabs(this,0);">供应信息分类</li>
                                    <li class="wtittxt" onclick="nTabs(this,1);">需求信息分类</li>
                                </ul>
                            </div>
                            <div class="TabContent">
                                <div id="myTab1_Content0">
                                    aaaaa
                                </div>
                                <div id="myTab1_Content1" class="none">
                                    ssssss
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="wrap2down">
                        <div class="nTab">
                            <div class="TabTitle">
                                <ul id="myTab2">
                                    <li class="current" onclick="nTabs(this,0);">供应信息</li>
                                    <li class="wtittxt" onclick="nTabs(this,1);">需求信息</li>
                                </ul>
                            </div>
                            <div class="TabContent">
                                <div id="myTab2_Content0">
                                   111111111111
                                </div>
                                <div id="myTab2_Content1" class="none">
                                  222222222222222
                                </div>
                            </div>
                        </div>
                    </div>
     <script type="text/javascript">
        function nTabs(thisObj,Num){
    if(thisObj.className == "current")return;
    var tabObj = thisObj.parentNode.id;
    var tabList = document.getElementById(tabObj).getElementsByTagName("li");
    for(i=0; i <tabList.length; i++)
    {
    if (i == Num)
    {
       thisObj.className = "current"; 
          document.getElementById(tabObj+"_Content"+i).style.display = "block";
    }else{
       tabList[i].className = "wtittxt"; 
       document.getElementById(tabObj+"_Content"+i).style.display = "none";
    }
    } 
    }</script>
  • 相关阅读:
    Simple ASP.NET CORE 2.2 App +Vue JS
    Upload Image to .NET Core 2.1 API
    Nginx支持WebSocket服务
    DD打卡
    Asp.net Core 源码-PagedList<T>
    Asp.net Core 源码-UrlExtensions
    Asp.net Core 源码-SessionExtensions
    树莓派资源集合
    frp内网穿透
    Nuget包含cssjs等资源文件
  • 原文地址:https://www.cnblogs.com/cnsg/p/2730765.html
Copyright © 2011-2022 走看看