I have two bootstrap columns \"left\" and \"right\"; I want to fix the left column with the screen and disable scroll. but i want to enable scroll in the right column which
Just add positon:fixed
and height:100%
to your left column and add data to your right column
https://codepen.io/anon/pen/JJgjqX
You can achieve this by simply applying some CSS:
Here is an example: https://jsfiddle.net/kLu69r7t/
.fixed-col {
height: 100vh;
}
.scrollable-col {
height: 100vh;
overflow-y: scroll;
}
Of course you need to give the columns the respective classes.
Just make the left column fixed. You don't need to use overflow-y
, it is used when you need scrolling within the element.
.fixed {position: fixed !important; top: 0px; left: 0px; bottom: 0px; background: red;}
.scrollable {background: yellow;}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="col-xs-3 fixed">
Fixed
</div>
<div class="col-xs-9 pull-right scrollable">
<br /><br /><br /><br /><br />Scrollable
<br /><br /><br /><br /><br />Scrollable
<br /><br /><br /><br /><br />Scrollable
<br /><br /><br /><br /><br />Scrollable
<br /><br /><br /><br /><br />Scrollable
<br /><br /><br /><br /><br />Scrollable
<br /><br /><br /><br /><br />Scrollable
<br /><br /><br /><br /><br />Scrollable
<br /><br /><br /><br /><br />Scrollable
<br /><br /><br /><br /><br />Scrollable
</div>