Skip to content

Instantly share code, notes, and snippets.

@bfintal
Created June 14, 2019 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bfintal/b653fa49d2c7b2c8ff11d21f029390ec to your computer and use it in GitHub Desktop.
Save bfintal/b653fa49d2c7b2c8ff11d21f029390ec to your computer and use it in GitHub Desktop.
setTimeout( function() {
var ttes = document.querySelectorAll( '.tte_wrapper' );
Array.prototype.forEach.call( ttes, function( el ) {
var typeAttr = el.getAttribute( 'data-effect' );
// Make the element visible and remove original text.
// Original text is for SEO.
var mid = el.querySelector( '.tte_mid' );
mid.innerHTML = '';
mid.style.opacity = '';
if ( typeAttr === 'typing' ) {
window._tteInitEffectType( el );
} else if ( typeAttr === 'fade' || typeAttr === 'top-to-bottom' || typeAttr === 'bottom-to-top' || typeAttr === 'vertical-flip' ) {
window._tteInitEffectFade( el );
} else if ( typeAttr === 'random-letters' ) {
window._tteInitEffectRandom( el );
} else if ( typeAttr === 'text-scrambled' ) {
window._tteInitEffectScrambled( el );
}
} );
}, 1 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment