JSFiddle - React, Tailwind, and code Playground
HTML
<div id="magic-pane" style="width: 300px; height: 400px; background: #eee; overflow: hidden">
<div id="scroller" style="width: 600px; height: 100%; left: 0px; position: relative">
<div id="pane1" style="width: 300px; height: 100%; background: #efe; float: left">
<span id="pane1-clicker">Whee, click me!</span>
</div>
<div id="pane2" style="width: 300px; height: 100%; background: #fee; float: left">
<span id="pane2-clicker">Whoosh! Click me!</span>
</div>
</div>
</div>
JavaScript
$(document).ready(function() {
$('#pane1-clicker').click(function() {
$('#scroller').animate({ left: '-300px' }, 500);
});
$('#pane2-clicker').click(function() {
$('#scroller').animate({ left: '0' }, 500);
});
});