Как создать частичное складное боковое меню ?
Привет я хочу создать частичное складное боковое меню используя мой выходящий код какой трюк он должен делать с моим bleow кодом (ссылка на jsFiddle)
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <body> <div id="wrapper"> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="navbar-brand"> <a id="menu-toggle" href="#" class="glyphicon glyphicon-align-justify btn-menu toggle"> </a> <a href="#">Project name</a> </div> </div> <div id="navbar" class="collapse navbar-collapse" style="float:right;"> <ul class="nav navbar-nav"> <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li> <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <!-- Sidebar --> <div id="sidebar-wrapper"> <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="glyphicon glyphicon-user" data-toggle="collapse" data-parent="#accordion" href="#collapse1"> Admin</a> </h4> </div> <div id="collapse1" class="panel-collapse collapse in"> <div class="panel-body"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="glyphicon glyphicon-equalizer" data-toggle="collapse" data-parent="#accordion" href="#collapse2"> Master</a> </h4> </div> <div id="collapse2" class="panel-collapse collapse"> <div class="panel-body"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="glyphicon glyphicon-transfer" data-toggle="collapse" data-parent="#accordion" href="#collapse3"> Transaction</a> </h4> </div> <div id="collapse3" class="panel-collapse collapse"> <div class="panel-body"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="glyphicon glyphicon-book" data-toggle="collapse" data-parent="#accordion" href="#collapse3"> Reports</a> </h4> </div> <div id="collapse3" class="panel-collapse collapse"> <div class="panel-body"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div> </div> </div> </div> </div> <!-- Page content --> <div id="page-content-wrapper"> <div class="page-content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div > <div > </div> <div class="well-sm" style="margin:0px; padding:0px" > </div> </div> </div> @*<div class="col-md-6"> <div class="panel panel-success"> <div class="panel-heading"> Panel 1 </div> <div class="panel-body"> content body </div> </div> </div>*@ </div> </div> </div> </div> </div> <div class="container body-content"> <hr /> <footer> <p>© - My Application</p> </footer> </div> <script> /*Menu-toggle*/ $("#menu-toggle").click(function (e) { e.preventDefault(); $("#wrapper").toggleClass("active"); //alert(1); }); </script>
Что я уже пробовал:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <body> <div id="wrapper"> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="navbar-brand"> <a id="menu-toggle" href="#" class="glyphicon glyphicon-align-justify btn-menu toggle"> </a> <a href="#">Project name</a> </div> </div> <div id="navbar" class="collapse navbar-collapse" style="float:right;"> <ul class="nav navbar-nav"> <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li> <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <!-- Sidebar --> <div id="sidebar-wrapper"> <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="glyphicon glyphicon-user" data-toggle="collapse" data-parent="#accordion" href="#collapse1"> Admin</a> </h4> </div> <div id="collapse1" class="panel-collapse collapse in"> <div class="panel-body"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="glyphicon glyphicon-equalizer" data-toggle="collapse" data-parent="#accordion" href="#collapse2"> Master</a> </h4> </div> <div id="collapse2" class="panel-collapse collapse"> <div class="panel-body"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="glyphicon glyphicon-transfer" data-toggle="collapse" data-parent="#accordion" href="#collapse3"> Transaction</a> </h4> </div> <div id="collapse3" class="panel-collapse collapse"> <div class="panel-body"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="glyphicon glyphicon-book" data-toggle="collapse" data-parent="#accordion" href="#collapse3"> Reports</a> </h4> </div> <div id="collapse3" class="panel-collapse collapse"> <div class="panel-body"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </div> </div> </div> </div> </div> <!-- Page content --> <div id="page-content-wrapper"> <div class="page-content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div > <div > </div> <div class="well-sm" style="margin:0px; padding:0px" > </div> </div> </div> @*<div class="col-md-6"> <div class="panel panel-success"> <div class="panel-heading"> Panel 1 </div> <div class="panel-body"> content body </div> </div> </div>*@ </div> </div> </div> </div> </div> <div class="container body-content"> <hr /> <footer> <p>© - My Application</p> </footer> </div> <script> /*Menu-toggle*/ $("#menu-toggle").click(function (e) { e.preventDefault(); $("#wrapper").toggleClass("active"); //alert(1); }); </script>
ZurdoDev
Вряд ли кто-то будет делать ВСЮ работу за вас.
Member 7969814
Привет ZurdoDev (MVP) я решил свою проблему, добавив этот код в свой существующий код
.Б{
дисплей:нет;
}
.Б.активный{
ширина:50px;
дисплей:блок;
}
.Ля{
дисплей:блок;
}
.А.активный {
дисплей:нет;
}
/*Меню-тумблер*/
$("#menu-toggle").click(функция (e) {
е.метод preventDefault();
$("#wrapper").toggleClass("активный");
$("#B").toggleClass("активный");
$("#A").toggleClass("активный");
//alert(1);
});
большое спасибо за то, что вы постоянно проявляете интерес к моему вопросу.
ZurdoDev
Пожалуйста, опубликуйте это как решение, чтобы это больше не оставалось без ответа.