JSFiddle - React, Tailwind, and code Playground
by Alfie
HTML
<input type="checkbox"/><label>Checked==show || unchecked ==slideDown</label>
<p> elements</p>
<p> elements</p>
<p> elements</p>
<p> elements</p>
<p> elements</p>
<p> elements</p>
<button>click</button>
CSS
p{
display:none;
}
JavaScript
var animation="slideDown";
$('input').on('change',function(){
this.checked?animation="show":animation="slideDown";
});
$('button').click(function(){
$('p')[animation]();
});