javascripts
 

SimplytheBest
Scripts

ASP scripts
PERL scripts
PHP scripts
JavaScripts & Ajax
Snippets
Online scripts

Ajax, DHTML
& JavaScripts

Animation
Background
Bookmarks
Buttons
Calculators
Cookies
Data handling
E-mail
Enhancements
Forms
Image rotation
Menus
Messages
Miscellaneous
Music
Password protection
Redirection
Scrollers
Tables
Time & date
Windows

Publishers
Add script
Account login
Publisher list



 

Home > Scripts > DHTML scripts & JavaScripts > Messages > Typing text message script

 

Typing text message script

AUTHOR: Submitted by Pla
TYPE: Freeware
BROWSERS: Javascript enabled all

This script allows the words in a string to appear in a text area one letter after another, just like someone is typing it. Easy to use.


EXAMPLE


1) Insert this script in the <HEAD> section of the page.

then copy (CTRL-C) & paste (CTRL-V)

 

2) Insert the onLoad event handler inside the <BODY> tag as follows:

<body onLoad=type_text(), followed by other tags such as bgcolor, etc..

copy (CTRL-C) & paste (CTRL-V)

3) Insert this <FORM> where you want the textbox to appear in the page:

copy (CTRL-C) & paste (CTRL-V)

4) Define the message in this section of the script:

var tl=new Array(
"Welcome to SimplytheBest DHTML Scripts.",
"A large collection of selected",
"DHTML scripts and JavaScripts.",
"FREE to use."  
// Note: do not add a comma (,) at the end of the last row of text
);

5) Adjust the speed of the typing text and the timeout length (when it switches to the next line of text) in this section of the script:

var speed=60; // The bigger the value the slower the speed

setTimeout("type_text()",1500); // The bigger the value the longer the break

Note: if you change the number or rows in the <TEXTAREA> (f.e. rows=10), in order to deactivate the vertical scrollbar, you'll also need to adjust the value in this section of the script:

row=Math.max(0,index-9); // Number of rows in the textarea (i.e. 10) minus one (i.e. 9)

6) Optionally you could combine this script with the scrollbar styles script to color the text area scrollbars.


[BACK] [TOP]

 


Copyright © 1997-2009 SimplytheBest Inc. Terms of Use and Legal Disclaimer.
All copyrights are acknowledged. All rights reserved.