Following code swaps the text after 5 second to some other text, which is implemented using JavaScript. I want to make the output text ( "outputtext1" and "outputtext2") look bigger like a heading, having orange color, and center aligned. How to do that?
The swapping of text works perfectly, there's no problem in the JavaScript code.
<html>
<head>
<style>
div.textContent {
display: none
}
</style>
<div id="textMessage"></div>
<div class="textContent">
<h2>"outputtext1"</h2></span>
</div>
<div class="textContent">
<h2>"outputtext2"</h2></span>
</div>
<script>
var cnt = 0,
texts = [];
// save the texts in an array for re-use
$(".textContent").each(function() {
texts[cnt++] = $(this).text();
});
function slide() {
if (cnt >= texts.length) cnt = 0;
$('#textMessage').html(texts[cnt++]);
$('#textMessage')
.fadeIn('slow').animate({
opacity: 1.0
}, 5000).fadeOut('slow',
function() {
return slide()
}
);
}
slide()
</script>
</html>