I want to create a full screen window using CSS, I have seen this question.
My problem is that my full screen window is quite long, and I get a scroll bar inside the main page... would be possible create a full screen window in such a way that I see only one scroll bar? (i.e. use the main scroll bar for the full screen window when it is open)
function toggleWindow() {
$('.fullScreenWindow').toggleClass('show');
}
.fullScreenWindow {
display: none;
}
.fullScreenWindow.show {
background-color: lightgrey;
display: block;
position: fixed;
padding: 10px;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 100;
overflow-x: hidden;
overflow-y: auto;
min-height: 100%;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!DOCTYPE html>
<html>
<body>
<button onclick="toggleWindow();">toggle window</button>
<div class="fullScreenWindow">
<br/><br/>
<h1> full screen window start</h1>
<br/><br/><br/><br/><br/><br/><br/><br/>
<h3>getting 2 scroll bars</h3>
<br/><br/><br/><br/><br/><br/><br/><br/>
<button onclick="toggleWindow();">close</button>
<h1> full screen window end</h1>
<br/><br/>
</div>
<h4> some long page ...</h4>
<br/><br/><br/><br/>
<h4> some long page ...</h4>
<br/><br/><br/><br/>
<h4> some long page ...</h4>
<br/><br/><br/><br/>
<h4> some long page ...</h4>
<br/><br/><br/><br/>
<h4> some long page ...</h4>
<br/><br/><br/><br/>
</body>
</html>