(function showNext(ids){ if(ids) showNext.ids = ids; if(!showNext.ids.length) return; $(showNext.ids.shift()).delay(300).fadeIn(1000, showNext) }([ '#years_text1', '#years_text2', '#years_text3', '#years_text4' ]))