JSFiddle - React, Tailwind, and code Playground
HTML
<div class="outer">
<div class="inner-left"></div>
<div class="inner-right"></div>
</div>
<input type="checkbox" id="toggle" /> Toggle 'overflow: hidden' on .outer
CSS
.outer {
width: 100px;
border: solid 5px #000;
}
.inner-left {
float: left;
height: 200px;
width: 50px;
background: #f00;
}
.inner-right {
float: right;
height: 200px;
width: 50px;
background: #0f0;
}
JavaScript
$("#toggle").click(function() {
$(".outer").css("overflow", $(this).is(":checked") ? "hidden" : "visible");
});