Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shelters fom the Storm
01-12-2021, 12:28 AM
Post: #1
Shelters fom the Storm
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.

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)