JSFiddle - React, Tailwind, and code Playground
by annam
HTML
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.10.3/TweenMax.min.js"></script>
<div id="box">
<div id="box-inner"></div>
</div>
<br><br>
<button id="go">Go</button>
<button id="reverse">Reverse</button>
CSS
#box {
width: 100px; height: 100px;
}
#box-inner {
width: 100%; height: 100%;
background: red;
}
JavaScript
var t = new TimelineMax({
paused: true
});
t.add(TweenLite.to('#box #box-inner', 2, { backgroundColor: 'green' }), 0)
t.add(function(){
$('#box').html('<div id="box-inner" style="background: green"/>');
}, 2)
$('#go').click(function(){
t.play();
});
$('#reverse').click(function(){
t.reverse();
});