<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>42度空间-弹性布局(flexbox) 之 align-content测试</title>
    <style>
        .box {
            display: flex;
            flex-wrap: wrap;
            border : 1px solid #ccc;
            margin:0.5em;
            height: 12em;
        }
        .item {
            color:#fff;
            background: #000;
            padding: 0.5em 1em;
            margin: 0.5em;
            text-align: center;
        }
        label {
            padding: 2px 4px;
            font-size: 90%;
            color: #c7254e;
            background-color: #f9f2f4;
            border-radius: 4px;
        }
    </style>
</head>
<body>
<div id="wrapper">
    <label for="box1" id="my-label">align-content: stretch; </label>
    <div class="box" id="box1">
        <div class="item">1 简单是稳定的前提。 </div>
        <div class="item">2 世界上有 10 种人,懂二进制的和不懂二进制的。</div>
        <div class="item">3 An ounce of prevention is worth a pound of cure.</div>
    </div>
</div>
<script type="text/javascript" src="http://res.42du.cn/vendor/jquery/jquery.min.js"></script>
<script>
    $(document).ready(function () {
        var vals = ["stretch","flex-start","flex-end","center","space-between","space-around","space-evenly"];
        var i = 1;
        var stop = false;
        var id = setInterval(function () {
            if(!stop) {
                $("#my-label").html("align-content: "+vals[i]+";");
                $("#box1").css("align-content",vals[i]);
                i++;
                i = i > 6 ? 0 : i;
            }
        },2000);
        $("#wrapper").click(function () {
            stop = !stop;
        });
    });
</script>
</body>
</html>