idchafee wrote:1. how do I display initial text on the page load. There is a delay before the first set of text is displayed
One way to do it is to modify the last piece of JS to look like so:
- Code: Select all
$(document).ready(function()
{
$("#textSpan").html(text[index]);
setInterval("rotateText()", 5000);
});
You'll see that I wrapped the original setInterval function inside another function "$(document).ready(function(){....});". What this does is tells the browser to wait until everything is done loading then execute the code inside. I moved the setInterval function inside and also added a line that sets the text of textSpan to the string at the default index.
idchafee wrote:2. How do I change the font size for the text that is displayed
You can accomplish this with CSS. As a quick example, paste the following code somewhere inside the head tag. What it does is change the style for anything with the ID of "textSpan" to have a font-size of x-large.
- Code: Select all
<style>
#textSpan
{
font-size:x-large;
}
</style>
Or you could use CSS classes and modify the span to look like so:
- Code: Select all
<span id="textSpan" class="big"></span>
and use this CSS instead:
- Code: Select all
<style>
.big
{
font-size:x-large;
}
</style>
I should also point out that you often want the CSS and JS to be in their own dedicated .css and .js files for caching but that's a topic for another day.
2600K @ 4.8GHz; XSPC Rasa/RX240/RX120 Phobya Xtreme 200; Asus P8Z68-V Pro; 16GB Corsair Vengeance 1333 C9; 2x7970 OC w/ Razor 7970; Force GT 120GB; 3x F3 1TB; Corsair HX750; X-Fi Titanium; Corsair Obsidian 650D; Dell 2408WFP Rev. A01; 2x Dell U2412m