I have the following bit of code which works fine in Mozilla, but just tested it in IE and it doesn’t seem to work, and I’m not good enough to see the issue.
<div id="container" style="margin-top:17px;">
<p style="color:white">
Health is our heritage, our right.<br/>
It is the complete and full union between soul, mind and body;<br/>
and this is not a difficult far-away ideal to attain,<br/>
but one so easy and natural…<br/>
that many of us have overlooked it.<br/>
Dr Edward Bach
</p>
</div>
<script>
function fadeInLine(line){
$('<span />', {
html: line.trim(),
style: "opacity: 0"
})
.appendTo($greeting)
.animate({opacity:1}, 1500);
}
function rotateLines(interval){
setTimeout(() => {
if (i >= lines.length){
i = 0;
interval = 4000;
setTimeout(()=>{ $greeting.empty(); }, interval)
} else {
fadeInLine(lines[i]);
i++;
interval = 1850;
}
rotateLines(interval);
}, interval);
}
const $greeting = $('div#container p');
const text = $greeting.html();
const lines = text.split("\n").filter((e) => e.replace(/\s+/, ""));
let i = 0;
$greeting.empty();
rotateLines();
</script>