JSFiddle - React, Tailwind, and code Playground
HTML
<button id="hidr" type="button">Hide</button>
<button id="showr" type="button">Show</button>
<div>
<span>동해물과</span> <span>백두산이</span>
<span>마르고</span> <span>닳도록</span>
<span>하느님이</span> <span>보우하사</span>
<span>우리나라</span> <span>만세</span>
</div>
CSS
span{float:left;padding:3px;background:#def3ca}
JavaScript
$('#hidr').click(function(){
// span의 가장 마지막 엘리먼트 hide 후 callback 실행
$('span:last-child').hide('fast', function(){
// this -> $('span:last-child')
// this의 이전 대상을 hide후 arguments 프로퍼티의 callee를 callback으로 실행
$(this).prev().hide('fast', arguments.callee);
console.log(arguments.callee);
});
});
$('#showr').click(function(){
$('span').show(2000);
});