may88seiji
9/13/2017 - 3:55 AM

showSplitText

showSplitText

$('p').children().addBack().contents().each(function() {
  if ( this.nodeType == 3 ) {
    $(this).replaceWith($(this).text().replace(/(\S)/g, '<span class="split-text">$1</span>'));
  }
});
$('.split-text').css('opacity', 0);
$('.split-text').each(function(i) {
  $(this).delay(i*50).animate({'opacity': 1}, 500);
});