I am trying to achieve a fade in/fade out effect for each word, displayed one after the other. Currently, the script either shows only the last word in the array or displays all words together. I am utilizing animate.css and JQuery for this transition of words. Any suggestions would be appreciated. Thank you.
<script>
var classes = [ '<h1 class="animated infinite rotateOutUpLeft">Software </h1>',
'<h1 class="animated infinite rotateOutUpLeft">project </h1>',
'<h1 class="animated infinite rotateOutUpLeft">Engineering</h1>',
'<h1 class="animated infinite rotateOutUpLeft">Science</h1>'
];
var display;
for (i = 0; i < classes.length; i++) {
document.write(i);
$("#tst").empty();
$("#tst").append(classes[i]);
// setTimeout(function(){alert('join');}, 10000);
// $("#tst").append(classes[i]);
// setTimeout(function(){$("#tst").append(classes[i]);}, 6000);
}
</script>