Добрый день, столкнулся с проблемой. Хотел сделать, чтобы до 1000px страницу отображало, как для мобильного экрана, но возникла проблема пропадает slide-menu при разрешении от 768px до 1000px.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<nav id="main-nav" class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="navbar-brand" href="/" style="color: gray;">Product-name</a>
</div>
<div id="slidemenu">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><b>Личный кабинет</b> <span class="caret"></span></a>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="#">Something there</a></li>
<li><a href="#">Something there</a></li>
<li><a href="#">Something there</a></li>
<li><a href="#">Something there</a></li>
<li><a href="#">Something there</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Something there</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav nabvbar-menu">
<li><a href="http://est5.ru/tsentr-krasoty-i-zdorovya/vzroslye.html" target="_blank">Something there</a>
</li>
<li><a href="http://est5.ru/klinika-stomatologii-i-implantologii/vzroslye.html" target="_blank">Something there</a>
</li>
<li><a href="http://est5.ru/detskij-tsentr-razvitiya-i-tvorchestva.html" target="_blank">Something there</a></li>
<li><a href=" http://est5.ru/tsentr-samorazvitiya-i-samopoznaniya/joga.html" target="_blank">Something there</a>
</li>
<li><a href="http://est-shop.ru/" target="_blank">Something there</a></li>
</ul>
</div>
</div>
</nav>
body.slide-active {
overflow-x: hidden
}
.no-margin-top {
margin-top: 0px!important
}
#page-content {
position: relative;
padding-top: 70px;
left: 0;
}
#page-content.slide-active {
padding-top: 0
}
#main-nav .navbar-toggle {
cursor: pointer;
position: relative;
line-height: 0;
float: left;
margin: 0;
width: 30px;
height: 40px;
padding: 10px 0 0 0;
border: 0;
background: transparent;
}
#main-nav .navbar-toggle>.icon-bar {
width: 100%;
display: block;
height: 3px;
margin: 5px 0 0 0;
}
#main-nav .navbar-toggle.slide-active .icon-bar {
background: #f8c957;
}
.navbar-header {
position: relative;
}
.navbar.navbar-fixed-top.slide-active {
position: relative;
}
#login-dp {
min-width: 250px;
padding: 14px 14px 0;
overflow: hidden;
background-color: white;
}
#login-dp .help-block {
font-size: 12px;
}
#login-dp .bottom {
background-color: rgba(255, 255, 255, .8);
border-top: 1px solid #ddd;
clear: both;
padding: 14px;
}
#login-dp .social-buttons {
margin: 12px 0;
}
#login-dp .social-buttons a {
width: 49%;
}
#login-dp .form-group {
margin-bottom: 10px;
}
@media screen and (max-width: 999px) {
body {
padding-top: 50px;
position: relative;
}
.navbar-static-top {
position: fixed;
top: 0;
width: 100%;
}
.navbar-nav #login-dp {
background-color: inherit;
color: gray;
}
.navbar-nav #login-dp .col-md-12 {
padding-right: 20px;
padding-left: 0;
min-width: 100px;
}
#login-dp .form {
width: 100%;
}
#login-dp .bottom {
background-color: inherit;
border-top: 0 none;
padding-right: 20px;
padding-left: 0;
min-width: 100px;
}
#slidemenu .navbar-right {
padding-top: 15px;
padding-left: 15px;
}
#slidemenu .nabvbar-menu {
padding-top: 15px;
padding-left: 15px;
}
.navbar-nav .dropdown-toggle .caret {
display: none;
}
.navbar-nav .dropdown-menu {
display: block;
}
.navbar-nav .dropdown>a {
outline: 0;
}
.navbar-nav .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
padding-bottom: 0;
background-color: transparent;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.navbar-default .navbar-nav .dropdown-menu>li>a {
padding: 5px 15px 5px 25px;
}
.navbar-default .navbar-nav .dropdown-menu>li>a {
line-height: 20px;
}
.navbar-default .navbar-nav>.open>a,
.navbar-default .navbar-nav>.open>a:focus,
.navbar-default .navbar-nav>.open>a:hover {
background-color: #f8f8f8;
color: gray;
}
.navbar-nav .dropdown-menu>li>a,
.navbar-nav .dropdown-menu>li>a:hover,
.navbar-nav .dropdown-menu>li>a:focus {
background-image: none;
text-transform: uppercase;
font-size: 12px;
}
.navbar-default .navbar-nav>li>a {
color: gray;
}
.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-nav>li>a:focus {
color: gray;
}
.navbar-default .navbar-nav .open .dropdown-menu>li>a {
color: gray;
padding: 5px 15px 5px 25px;
}
.navbar-default .navbar-nav .dropdown-menu>li>a {
color: gray;
}
.navbar-default .navbar-nav .open .dropdown-menu .divider {
background-color: #e5e5e5;
margin-top: 5px;
margin-bottom: 5px;
}
.navbar-default .navbar-nav .dropdown-menu .divider {
background-color: #e5e5e5;
margin-top: 5px;
margin-bottom: 5px;
}
#main-nav .container {
margin: 0;
padding: 0!important;
}
#main-nav .navbar-header {
margin: 0 auto;
padding: 0 15px;
}
#main-nav .navbar.slide-active {
position: absolute;
width: 80%;
top: -1px;
z-index: 1000;
}
#main-nav #slidemenu {
background: #f8f8f8;
left: -100%;
width: 80%;
min-width: 0;
position: absolute;
padding-left: 0;
z-index: 2;
top: -8px;
margin: 0;
}
#main-nav #slidemenu .navbar-nav {
min-width: 0;
width: 100%;
margin: 0;
}
#main-nav #slidemenu .navbar-nav .dropdown-menu li a {
min-width: 0;
width: 80%;
white-space: normal;
background-color: #f8f8f8;
}
#main-nav #slidemenu .navbar-nav .dropdown-menu li a:hover {
color: gray;
}
#main-nav {
border-top: 0
}
#main-nav #navbar-height-col {
position: fixed;
top: 0;
height: 100%;
width: 80%;
left: -80%;
background: #f8f8f8;
}
#main-nav .navbar-form {
width: 100%;
margin: 8px 0;
text-align: center;
overflow: hidden;
/*fast clearfixer*/
}
#main-nav .navbar-form .form-control {
text-align: center
}
#main-nav .navbar-form .btn {
width: 100%
}
.side-collapse.in {
width: 0;
}
}
@media (min-width: 1000px) {
#page-content {
left: 0!important
}
.navbar.navbar-fixed-top.slide-active {
position: fixed
}
.navbar-header {
left: 0!important
}
}
$(document).ready(function() {
$('#main-nav.navbar .container-fluid').append($('<div id="navbar-height-col"></div>'));
var toggler = '.navbar-toggle';
var pagewrapper = '#page-content';
var navigationwrapper = '.navbar-header';
var menuwidth = '100%';
var slidewidth = '80%';
var menuneg = '-100%';
var slideneg = '-80%';
$("#main-nav").on("click", toggler, function(e) {
var selected = $(this).hasClass('slide-active');
$('#slidemenu').stop().animate({
left: selected ? menuneg : '0px'
});
$('#navbar-height-col').stop().animate({
left: selected ? slideneg : '0px'
});
$(pagewrapper).stop().animate({
left: selected ? '0px' : slidewidth
});
$(navigationwrapper).stop().animate({
left: selected ? '0px' : slidewidth
});
$(this).toggleClass('slide-active', !selected);
$('#slidemenu').toggleClass('slide-active');
$('#page-content, .navbar, body, .navbar-header').toggleClass('slide-active');
});
var selected = '#slidemenu, #page-content, body, .navbar, .navbar-header';
$(window).on("resize", function() {
if ($(window).width() > 999 && $('.navbar-toggle').is(':hidden')) {
$(selected).removeClass('slide-active');
}
});
});
https://jsfiddle.net/s47vjcqs/3/