I am attempting to create a sidebar which can scroll, but the main content on the right is fixed (no scroll).
But when I try to work around it does not work, so here is an example
HTML
<div id="container">
<div id="outer-wrapper" class="is-open">
<div id="inner-wrapper">
</div>
<div id="sidebar">
</div>
</div>
</div>
CSS
#sidebar {
height: 100%;
position: absolute;
top: 0;
left: -80%;
width: 80%;
}
.is-open {
//expose the sidebar by translating the wrapper
-webkit-transform: translateX(80%);
transform: translateX(80%);
}
#container {
//disables horizontal scroll
overflow: hidden;
}
Here is the fiddle that might help with testing https://jsfiddle.net/minheq/tn2no1o6/3/
Please, any advice on this?
Something like this?
body {
width: 100%;
height: 100%;
overflow: hidden;
}
.container, .wrapper {
display: block;
width: 100%;
height: 100%;
overflow: hidden;
}
.content {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 0;
background: #ddd;
padding: 10px;
padding-left: 230px;
}
.sidebar {
width: 200px;
height: 100%;
position: absolute;
left: 0;
top: 0;
padding: 10px;
background: #849;
overflow: auto;
}
.sidebar-content {
width: 100%;
height: 600px;
background: #994;
z-index: 1;
}
<div class="container">
<div class="wrapper">
<div class="content">Lorem ipsum dolor</div>
<div class="sidebar">
<div class="sidebar-content">Amet dolor ipsum</div>
</div>
</div>
</div>