DevelopPHP
home Forum gear home

Libraries book

HTML Library CSS Library JavaScript Library PHP Library

Videosbook

PHP and MySQL JavaScript HTML and CSS Vector and 3D Flash Actionscript Android Dev Miscellaneous

Resourcesbook

Website Hosting
<iframe width="560" height="315" src="http://www.youtube.com/embed/co7RPq2Ox90" frameborder="0" allowfullscreen></iframe>
You can embed this video on your blog or web page by copying the video embed code above and pasting it into the source code of your page. Adjust the width and height to specify the size you would like it to display.
Thumb Typing Text Animation Tutorial Timed Loops and Array Programming Using Javascript
Embed Source - http://www.youtube.com/watch?v=co7RPq2Ox90
Publish Date - Mar 06, 2011     Author - Adam Khoury
Typing Text Animation Tutorial Timed Loops and Array Programming Using Javascript
Learn to program arrays and timed loops in Javascript to animate typing text. We string.split() any string into an array, that we can then use array.shift() on to pluck each element off of the front of the array that represents your string.
Lesson Code
<html>
<head>
<style type="text/css">
#myTypingText {
background-color:#000;
width:700px;
height:120px;
padding:12px;
color:#FFF;
font-family:Arial, Helvetica, sans-serif;
    font-size:16px;
line-height:1.5em;
}
</style>
</head>
<body>
<div id="myTypingText"></div>
<script type="text/javascript" language="javascript">
var myString = "Place your string data here, and as much as you like.";
var myArray = myString.split("");
var loopTimer;
function frameLooper() {
if(myArray.length > 0) {
document.getElementById("myTypingText").innerHTML += myArray.shift();
} else {
clearTimeout(loopTimer); 
}
loopTimer = setTimeout('frameLooper()',70);
}
frameLooper();
</script>
</body>
</html>

Home   •   Terms of Use   •   Developer Forums   •   T-Shirts   •   RSS   •   Classroom Chalkboard   •   Donate   •   Top ↑
Popular In PHP / MySQL E-Commerce Store Production
Social Network Website Building
Image Upload / Photo Processing
CMS Software Programming
Mass Email Systems
Magic XML Data
Search Programming
Popular In JavaScript JSON Programming
Ajax Programming
Animating Elements
WYSIWYG Programming
Date/Time Programming
DOM Scripting
Object Reference
Popular In HTML Canvas Element
New Form Elements
Audio Element
Video Element
Drag and Drop
Event Handling
Element Grouping
Popular In CSS Custom Font Embedding
Dynamic Fit Backgrounds
Theatre Mode
Box Overlays
CSS Level 1 Properties
CSS Level 2 Properties
CSS Level 3 Properties
©2013 DevelopPHP   |   Navigate to related domains HTML5