Я скачал отзывчивый шаблон боковой панели bootstrap из inte rnet. Когда я изменил шаблон на «сетку», боковая панель перестала отвечать - PullRequest
0 голосов
/ 15 апреля 2020

Я загрузил файл в (https://drive.google.com/file/d/1jVd39vSsEXPqNMcHntJFLmIxihfu-f9u/view?usp=sharing). В прикрепленном файле index_1. html работает хорошо, но index_2. html не работает, я хочу, чтобы index_2. html работал точно так же, как index_1. html, пожалуйста. Большое спасибо!

Ниже приведен код, для которого прекрасно работает отзывчивость боковой панели:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Simple Sidebar - Start Bootstrap Template</title>
<link href="Style/bootstrap.min.css" rel="stylesheet">
<link href="Style/simple-sidebar_1.css" rel="stylesheet">
</head>
<body>
<div class="d-flex" id="wrapper">
<!-- Sidebar -->
<div class="bg-dark border-right border-dark" id="sidebar-wrapper">
<div class="sticky-top"><!-- Fixed non-scrollable fixed menu -->
<div class="sidebar-heading bg-dark text-white">Topic</div>
<div class="list-group list-group-flush">
<a href="#" class="list-group-item list-group-item-action bg-light">Nav1</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav2</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav3</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav4</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav5</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav6</a>
</div>
</div>
</div>  
<div id="page-content-wrapper">
<nav class="navbar p-2 bg-dark sticky-top border-bottom">
<button class="btn rounded-0 btn-outline-light" id="menu-toggle">Show/Hide Topic</button>
<h6 class="text-white mr-3">www.AAW.com</h6>
</nav>
<div class="container-fluid">
<h1 class="mt-4">Simple Sidebar</h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
</div>
</div>
</div>
<script src="Scripts/jquery.min.js"></script>
<script>
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
</script>
</body>
</html>

работает css

body {overflow-x: hidden;}
#wrapper{border-style: solid;border-color: dark;}
#sidebar-wrapper {min-height: 100vh;margin-left: -15rem;-webkit-transition: margin .25s ease-out;-moz-transition: margin .25s ease-out;-o-transition: margin .25s ease-out;transition: margin .25s ease-out;}
#sidebar-wrapper .sidebar-heading {padding: 0.9375rem;font-size: 1rem;}
#sidebar-wrapper .list-group {width: 15rem;}
#page-content-wrapper {min-width: 100vw;}
#wrapper.toggled #sidebar-wrapper {margin-left: 0;}
@media (min-width: 768px) {#sidebar-wrapper {margin-left: 0;}
#page-content-wrapper {min-width: 0;width: 100%;}
#wrapper.toggled #sidebar-wrapper {margin-left: -15rem;}}

Ниже приведен код компоновки сетки, для которого боковая панель не работает:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Simple Sidebar - Start Bootstrap Template</title>
<link href="Style/bootstrap.min.css" rel="stylesheet">
<link href="Style/simple-sidebar_2.css" rel="stylesheet">
</head>
<body>
<div class="container px-lg-5" id="Area">
<div class="row no-gutters mx-lg-n5">
<div class="col-sm-3 bg-dark border-right border-dark" id="Col-1">
<!-- Sidebar -->
<div id="Navigation">
<div class="sticky-top"><!-- Fixed non-scrollable Navigation -->
<div class="sidebar-heading bg-dark text-white">Topic</div>
<div class="list-group list-group-flush">
<a href="#" class="list-group-item list-group-item-action bg-light">Nav1</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav2</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav3</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav4</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav5</a>
<a href="#" class="list-group-item list-group-item-action bg-light">Nav6</a>
</div>
</div>
</div>
</div>
<div class="col-sm-9" id="Col-2">   
<nav class="navbar p-2 bg-dark sticky-top border-bottom">
<button class="btn rounded-0 btn-outline-light" id="menu-toggle">Show/Hide Topic</button>
<h6 class="text-white mr-3">www.AAW.com</h6>
</nav>
<div id="Illustration">
<h1 class="mt-4">Heading</h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p> 
</div>
</div>
</div>
</div>
<script src="Scripts/jquery.min.js"></script>
<script>
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#Area").toggleClass("toggled");
});
</script>
</body>
</html>

нерабочий css

body {overflow-x: hidden;}
#Area{border-style: solid;border-color: dark;}
#Navigation {min-height: 600px;margin-left: -15rem;-webkit-transition: margin .25s ease-out;-moz-transition: margin .25s ease-out;-o-transition: margin .25s ease-out;transition: margin .25s ease-out;}
#Navigation .sidebar-heading {padding: 0.9375rem;font-size: 1rem;}
#Navigation .list-group {width: 100%;}
#Illustration {min-width: 100%;padding: 10px;}
#Area.toggled #Navigation {margin-left: 0;}
@media (min-width: 768px) {#Navigation {margin-left: 0;}
#Illustration {min-width: 0;width: 100%;}
#Area.toggled #Navigation {margin-left: 100%;}}
...