جافا جميلة لجعل النص يكتب كأنك تكتبه الآن ككتابة الآلة الكاتبة:
كود بلغة HTML:
<SCRIPT LANGUAGE = "JavaScript">
<!--
function AraVob() {
}
var ScreenLine = new AraVob();
ScreenLine[1] = "السطر الأول";
ScreenLine[2] = "السطر الثاني";
ScreenLine[3] = "السطر الثالث";
ScreenLine[4] = "السطر الرابع";
ScreenLine[5] = "السطر الخامس";
ScreenLine[6] = "السطر السادس";
ScreenLine[7] = "السطر السابع";
ScreenLine[8] = "السطر الثامن";
ScreenLine[9] = "السطر التاسع";
ScreenLine[10] = "السطر العاشر";
/*
To change or add lines, just replace values of or add to ScreenLine[n]
above. Use \" in the message text for quotes and \t for tabs.
*/
var msgNum = 1; // set to first message to display
var msgCnt = 10; // set to number of last ScreenLine to display.
var typeSpeed = 50; // the typing rate in milliseconds (higher number type more slowly)
var lineDelay = 2000 // the delay time at end of line. (unless the line is a single space)
var pagLen = 6; // number of lines per page (usually the number of rows in the TEXTAREA)
var delay = typeSpeed;
var timerPS = null;
var linPntr = 0;
var tally = 1;
var msg = " ";
var outMsg = "";
var i = 0;
// set up ScreenLines for display
var typingon = true;
for (x = msgCnt; 1 <= x; x--) {
ScreenLine[x+pagLen] = ScreenLine[x] + "\r\n";
}
for (x = 1; x <= (pagLen); x++) {
ScreenLine[x] = " \r\n";
}
msgCnt += pagLen;
msg = ScreenLine[1];
// end setup
function SwitchIt() {
typingon = !typingon;
}
function DisplayScroll() {
if (msgNum < pagLen) {
delay = typeSpeed;
}
else {
delay = lineDelay;
}
ChangeMsg();
outMsg += msg;
self.document.regi.msgarea.value = outMsg;
if (typingon == true) {
timerPS = setTimeout("DisplayMsg()",delay);
}
else {
clearTimeout(timerPS);
timerPS = setTimeout("DisplayScroll()",delay);
}
}
function DisplayMsg() {
if (msg.length <= i) {
i = 0;
ChangeMsg();
}
outMsg += msg.charAt(i);
i++;
if (msg.charAt(i) != "\n" || msg == " \r\n") {
delay = typeSpeed;
}
else {
delay = lineDelay;
}
self.document.regi.msgarea.value = outMsg;
if (typingon == false) {
timerPS = setTimeout("DisplayScroll()",delay);
}
else {
clearTimeout(timerPS);
timerPS = setTimeout("DisplayMsg()",delay);
}
}
function ChangeMsg() {
msgNum++;
if (msgCnt < msgNum) {
msgNum = 1;
}
if (pagLen <= tally) {
chgPage();
}
tally++;
msg = ScreenLine[msgNum];
}
function chgPage() {
if (msgNum < pagLen) {
linPntr = msgCnt - pagLen + msgNum + 1;
}
else {
linPntr = msgNum - (pagLen - 1);
}
outMsg = ScreenLine[linPntr];
for (p = 1; p < (pagLen - 1); p++) {
linPntr++;
if (msgCnt < linPntr) {
linPntr = 1;
}
outMsg += ScreenLine[linPntr];
}
}
function quitDisplay() {
self.document.regi.msgarea.value = "Type a Page for yourself today!";
}
setTimeout("DisplayMsg()",1000);
// -->
</SCRIPT>
<form name='regi' action='' method='post' dir="rtl">
<TEXTAREA NAME = "msgarea" style=".formf2 {background:#FFFFFF;font-family:Tahoma,Helvetica,MS Sans serif;width:400px;height:130px;font-size:8pt;border-style:solid;border-width:1;border-color:#D7D7D7;color:#000000;" rows="1" cols="20">
</textarea>
</form>
__________________