I have a page with a form that's broken into two sections. There is only one section visible at a time, the second section is animated in (using jQuery) after the user completes the first section and clicks next.
The way I have that setup in HTML is as follows:
<div class="form-container">
<form>
<div class="sections-container">
<div class="section">...</div>
<div class="section">...</div>
</div>
</form>
</div>
The CSS for that looks like this:
form {
overflow: hidden;
}
.sections-container {
width: 200%;
}
.sections-container::after {
clear: both;
content: '';
display: block;
}
.section {
float: left;
width: 50%
}
When a user clicks "next", using jQuery, the .sections-container gets a negative margin-left applied to horizontally slide in the second form section.
The problem is in Chrome, when the dev tools are open with the mobile device view enabled, I can still scroll the page horizontally, though no scrollbar is visible. Why is this happening when I have overflow set to hidden, and how do I fix this so that the page cannot be scrolled?