JSFiddle - React, Tailwind, and code Playground

by thirtydot

HTML

<div class="row">
    <div class="actionPanel">Click</div><div class="resultPanel">Result panel</div>
</div>

CSS

body {
    padding:10px;
}
.row {
    width:500px;
    height: 50px;
    overflow:hidden;
    border:1px solid #ccc;
    white-space: nowrap;
}
.resultPanel {
    display:inline-block;
    width:450px;
    height: 50px;
    background: #ddd;
}
.actionPanel {
    display:inline-block;
    width:50px;
    height: 50px;
    background:#eee;
}

JavaScript

$(".actionPanel").on("click", function () {
    $(this).animate({
        width: ["200px", "swing"]
    }, 500, function () {
        // Animation complete.
    });
});