I have a div that text can be dynamically added to. Using CSS regions, I make the text flow from one div to another. However, it seems I have to know how many divs I need in advance for fit the text. I want to only create a div to flow into when the one before it overflows. I haven't been able to find an onOverflow event. Below is my working static example that I modified from the HTMLRocks example. I would like this but without having to create 3 "regions" up front. I'd prefer to only create one at first and then generate others as needed. Thanks.
<!DOCTYPE html>
<html>
<head>
<style>
#content {
-webkit-flow-into: article-flow;
display: -webkit-flex;
display: flex;
}
.region {
-webkit-flow-from: article-flow;
box-sizing: border-box;
width: 100px;
height: 100px;
padding: 10px;
border: solid 2px black;
}
</style>
</head>
<body>
<div class="region"></div>
<div class="region"></div>
<div class="region"></div>
<div id="content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
</body>
</html>