JSFiddle - React, Tailwind, and code Playground

by Kamlesh Kushwaha

HTML

<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>

CSS

.item {
    padding:20px;
    border:1px solid black;
    float:left
}

JavaScript

$(function () {
    var itemHeight = $('.item').height();

    function resizer() {
        $('.item').each(function () {
            $(this).css({
                height: itemHeight + 'px'
            });
        });
    }
    $(window).on('resize', function (event) {
        itemHeight = $("body").width() / $(".item").length; //any different value
        resizer();
    });
})