TandemTables Forum

Full Version: Shelters fom the Storm
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
http://d21c.com/leprofesseur/Shelter.html

This demonstrates typewriter text and a moving background.

This how to create and position the typewriter text.

<script>
var i = 0;
var txt = 'some text to use.';
var speed = 50;


function marquee() {
if (i < txt.length) {
document.getElementById("show").innerHTML += txt.charAt(i);
i++;
setTimeout(marquee, speed);<!---->set speed to value. higher value slower text-->
}
}
</script>

<style>


#show{<!------>This id matches the id in the script. It positions and styles the text
position:absolute;left:210px;top:450px;
width:1000px;height:140px;
text-align:justify; <------>set text alignment for proper typewriter effect
}

<body>

<div id=show></div> <!---->this div displays the text

The moving background was created using a trick. I'll leave the method up to the detectives to sleuths here, You'll laugh when you see how simple it is.

Very nice work Professor.
Reference URL's