I built a rotating text with fade in from code i found on the web, i only have a basic code understanding.
quotation[2] needs three lines and others only two, so it moves the site below up and down as it rotates. is there anyway to set a half
in this code so i can have a half space above and below the sentence? or to centre the third quote only.
i tried a css with span 0.5em method, but the span wouldnt work inside the rest of this code.
thanks
(site is www.focallocal.org)
<DIV id=textrotator style="FONT: 18px arial ; text-align:centre; WIDTH: 100%; COLOR: rgb(255,255,255)"></DIV>
<body bgcolor="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF" topmargin="0" leftmargin="0" rightmargin="0">
<script type = "text/javascript">
var hexinput = 255; // initial color value.
quotation = new Array()
quotation[0] = "<br />A simple and fun way to make the world and your community a happier, more connected place in your free time<br /><br />"
quotation[1] = "<br />Discover how you can shape the world in your spare time through Collective Action<br /><br />"
quotation[2] = "Bringing people and their communities closer together and dealing with serious societal issues in a constructive, light-hearted, adventurous and enjoyable way"
function fadingtext()
{
if(hexinput >111)
{
hexinput -=11; // increase color value
document.getElementById("textrotator").style.color="rgb("+hexinput+","+hexinput+","+hexinput+")"; // Set color value.
setTimeout("fadingtext()",300); // 300ms per step
}
else
{
hexinput = 255; //reset hex value
}
}
var which = 0;
function changetext()
{
which += 1;
if (which >= quotation.length)
{
which = 0;
}
document.getElementById("textrotator").innerHTML = quotation[which];
fadingtext();
setTimeout("changetext()",8000);
}
window.onload = changetext();
</script></div>