Forum Moderators: open
<script type='text/javascript'>
$( document ).ready(function() {
$('.message').each(function(index,i) {
$(this).delay(index * 20000).show(0);
$(this).delay(index * 20000).hide(0);
});
});
</script>
<style>
.content {
display: none;
}
</style>
<div id='container'>
<div class='content'>Blah Blah</div>
<div class='content'>Foo</div>
<div class='content'>Bar</div>
<div class='content'>Lorem Ipsum</div>
</div>
$( document ).ready(function() {
var contentList = $('.content'),
count = contentList.length,
index = 0,
current = $(contentList[index]),
delay = 20000;
function showNext() {
if (++index >= count) index = 0;
var next = $(contentList[index]);
current.hide();
next.show();
current = next;
setTimeout(showNext, delay);
}
$(current).show();
setTimeout(showNext, delay);
});