Created
June 14, 2019 10:07
-
-
Save bfintal/b653fa49d2c7b2c8ff11d21f029390ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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