Explaining this concept may be a bit challenging, so I have included a jsfiddle demo. The issue at hand involves a bootstrap nav
menu that shifts to icons when not active and expands to include words when focused. When the menu is expanded, there are no scroll bars as intended. However, an unwanted horizontal scroll bar appears when the nav
menu is collapsed. How can the horizontal scroll bar be hidden when the menu is in its collapsed state?
$('#sidebar').mouseover(function() {
if($('.row-offcanvas').hasClass("active")){
$('.row-offcanvas').toggleClass('active');
$('.collapse').toggleClass('in').toggleClass('hidden-xs').toggleClass('visible-xs');
$('#main').removeClass('expanded');
}
}).mouseout(function() {
$('.row-offcanvas').toggleClass('active');
$('.collapse').toggleClass('in').toggleClass('hidden-xs').toggleClass('visible-xs');
$('#main').addClass('expanded');
});
html, body {
height: 100%;
}
.wrapper, .row {
height: 100%;
margin-left:0;
margin-right:0;
}
...
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="wrapper">
...
</div>
</div>
</div>
</div>