I am creating a website and upon entering the site I want a sentence to fade in letter by letter and after a set period of time, fade away as an entire sentence. I have some code that makes the letters appear letter by letter but I need them to "fade in" rather then just appearing. Then once the entire sentence is displayed it will all fade away at once and not repeat. I will also need to reference this with CSS.
var showText = function (target, message, index, interval) {
if (index < message.length) {
$(target).append(message[index++]);
setTimeout(function () { showText(target, message, index, interval); }, interval);
}
}
$(function () {
showText("#msg", "Hello, World!", 0, 500);
});
The link below is to the letters appearing letter by letter.
Thank you for any help!!!