2017-02-25 126 views
0

這可能很容易爲所有人,但我不明白爲什麼我的表單添加用戶輸出的底部,即使我添加分頁到我的UL類它會添加設計到下拉菜單,但仍然有一個表單我嘗試使用jQuery隱藏,但如果我顯示和隱藏元素,將需要大量.show和.hide希望它可以概括,也隱藏表單隱藏bootstrap窗體並使用分頁

  <!DOCTYPE html> 
      <html lang="en"> 
       <head> 
       <meta charset="utf-8"> 
       <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
       <meta name="description" content="SHIELD - Free Bootstrap 3 Theme"> 
       <meta name="author" content="Carlos Alvarez - Alvarez.is - blacktie.co"> 
       <link rel="shortcut icon" href="assets/ico/favicon.png"> 


       <!-- Bootstrap core CSS --> 
       <link href="assets/css/bootstrap.css" rel="stylesheet"> 

       <!-- Custom styles for this template --> 
       <link href="assets/css/main.css" rel="stylesheet"> 
       <link rel="stylesheet" href="assets/css/icomoon.css"> 
       <link href="assets/css/animate-custom.css" rel="stylesheet"> 



       <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic' rel='stylesheet' type='text/css'> 
       <link href='http://fonts.googleapis.com/css?family=Raleway:400,300,700' rel='stylesheet' type='text/css'> 

       <script src="assets/js/jquery.min.js"></script> 
       <script type="text/javascript" src="assets/js/modernizr.custom.js"></script> 

       <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> 
       <!--[if lt IE 9]> 
        <script src="assets/js/html5shiv.js"></script> 
        <script src="assets/js/respond.min.js"></script> 
       <![endif]--> 
       </head> 

       <body data-spy="scroll" data-offset="0" data-target="#navbar-main"> 


       <div id="navbar-main"> 
        <!-- Fixed navbar --> 
       <div class="navbar navbar-inverse navbar-fixed-top" > 
        <div class="container"> 
        <div class="navbar-header"> 
         <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> 
         <span class="icon icon-shield" style="font-size:30px; color:#3498db;"></span> 
         </button> 
         <a class="navbar-brand hidden-xs hidden-sm" href="#home"><span class="icon icon-shield" style="font-size:18px; color:#3498db;"></span></a> 
        </div> 
        <div class="navbar-collapse collapse"> 
         <ul class="nav navbar-nav" style = "font-weight:strong; font-family:Verdana;"> 
         <li><a href="index.html" class="smoothScroll">Home</a></li> 
         <li> <a href="#about" class="smoothScroll"> About</a></li> 
         <li> <a href="#services" class="smoothScroll"> Services</a></li> 
         <li> <a href="#team" class="smoothScroll"> Team</a></li> 
         <li> <a href="#portfolio" class="smoothScroll"> Portfolio</a></li> 
         <li> <a href="#blog" class="smoothScroll"> Blog</a></li> 
         <li> <a href="#contact" class="smoothScroll"> Contact</a></li></ul> 
         <div style = "position:relative; left:550px;"> 
          <ul class="nav navbar-nav" style = "font-weight:strong; font-family:Verdana; margin-right:0px;"> 
           <li> <a href="index.html" class="smoothScroll"> Logout</a></li> 
           </ul> 
         </div> 




        </div> 
        </div> 
       </div> 
       </div> 
      <!--/.nav-collapse --> 

      <nav class="navbar navbar-default sidebar" role="navigation"> 
       <div class="container-fluid"> 
       <div class="navbar-header"> 
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-sidebar-navbar-collapse-1"> 
        <span class="sr-only">Toggle navigation</span> 
        <span class="icon-bar"></span> 
        <span class="icon-bar"></span> 
        <span class="icon-bar"></span> 
        </button>  
       </div> 
       <div class="collapse navbar-collapse" id="bs-sidebar-navbar-collapse-1"> 
        <ul class="nav navbar-nav"> 
        <li class="active"><a href="#home">Home<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-home"></span></a></li> 
        <li class="dropdown"> 
         <a href="#" class="dropdown-toggle" data-toggle="dropdown">Manage Users<span class="caret"></span><span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-user"></span></a> 
         <ul class="dropdown-menu forAnimate" role="menu"> 
         <li><a href="#" data-target = "#home" data-toggle="collapse">Add</a></li> 
         <li><a href="#">Edit Employee Information</a></li> 
         <li><a href="#">Report</a></li> 
         <li class="divider"></li> 
         <li><a href="#">All Users</a></li> 
         <li class="divider"></li> 
         <li><a href="#">Audit Trail</a></li> 
         </ul> 
        </li>   
        <li ><a href="#">Announcements<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-bullhorn"></span></a></li>   
        <li ><a href="#">Orders<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-shopping-cart"></span></a></li> 
        <li ><a href="#">Stocks<span style="font-size:16px;" class="pull-right hidden-xs showopacity glyphicon glyphicon-th-list"></span></a></li> 
        </ul> 

       </div> 
       </div> 
      </nav> 
      <form id = "home"> 
       <!-- ==== PORTFOLIO ==== --> 
        <div class="container" id="portfolio" name="portfolio"> 
        <br> 
         <div class="row"> 
          <br> 
          <h1 class="centered">Admin</h1> 
          <hr> 
          <br> 
          <br> 
         </div><!-- /row --> 
         <div class="container"> 

         <div class="row"> 

         </div> 
         </div> 
        </div> 
      </form> 
      <form id = "adduser"> 
       <!-- ==== PORTFOLIO ==== --> 
        <div class="container" id="portfolio" name="portfolio"> 
        <br> 
         <div class="row"> 
          <br> 
          <h1 class="centered">Add User</h1> 
          <hr> 
          <br> 
          <br> 
         </div><!-- /row --> 
         <div class="container"> 

         <div class="row"> 

         </div> 
         </div> 
        </div> 
      </form>   

      <!-- Bootstrap core JavaScript 
       ================================================== --> 
       <!-- Placed at the end of the document so the pages load faster --> 


       <script type="text/javascript" src="assets/js/bootstrap.min.js"></script> 
       <script type="text/javascript" src="assets/js/retina.js"></script> 
       <script type="text/javascript" src="assets/js/jquery.easing.1.3.js"></script> 
       <script type="text/javascript" src="assets/js/smoothscroll.js"></script> 
       <script type="text/javascript" src="assets/js/jquery-func.js"></script> 
       <script> 
       $(document).ready(function(){ 
        $("#adduser").hide(); 
       }); 
       </script> 
       </body> 
      </html> 

如果我點擊的家管理員表單將顯示,如果我點擊添加添加表單將被顯示,並且管理表單將被隱藏

+0

我爲你的問題創建了一個jsfiddle。你可以編輯它,並添加所有的HTML,請編輯你的問題,並使其更清楚https://jsfiddle.net/moneer99/acxnzpfj/ – Mouneer

+0

你能幫助我..現在更容易理解嗎?對不起新引導 –

+0

請更新這個小提琴https://jsfiddle.net/moneer99/acxnzpfj/2/我看不到任何切換按鈕 – Mouneer

回答

0

你想要實現的是一個動態頁面導航(不是paginati上)

總體思路:Demo

<!-- Nav tabs --> 
<ul class="nav nav-tabs" id="nav"> 
    <li><a href="#add" data-toggle="tab">Add</a></li> 
    <li><a href="#edit" data-toggle="tab">Edit</a></li> 
    <li><a href="#report" data-toggle="tab">report</a></li> 
</ul> 

<!-- Tab panes --> 
<div class="tab-content"> 
    <div class="tab-pane" id="add">This is add</div> 
    <div class="tab-pane" id="edit">This is edit</div> 
    <div class="tab-pane" id="report">This is report</div> 
</div> 

和我申請到您的示例here。希望這可以幫助