Ενα κείμενο σαν γραφομηχανή

Κώδικας, πληροφορίες, ερωτήσεις και απαντήσεις σχετικές με την JavaScript.

Συντονιστές: WebDev Moderators, Super-Moderators

Απάντηση
kostas-theod
Δημοσιεύσεις: 222
Εγγραφή: 11 Ιαν 2004 09:15
Τοποθεσία: Πάτρα-ΕΛΛΑΔΑ

Ενα κείμενο σαν γραφομηχανή

Δημοσίευση από kostas-theod » 10 Ιουν 2005 19:19

Πως μπορώ να κανω μια πρόταση να εμφανίζεται λες και πατας πληκτρα σε γραφομηχανή?

Να βγαινει ενα ενα το γραμμα και στο τέλος να μένει η προταση.

Σας ευχαριστώ ,

Άβαταρ μέλους
Knorcedger
Script Master
Δημοσιεύσεις: 1226
Εγγραφή: 18 Μάιος 2004 04:29
Επικοινωνία:

Ενα κείμενο σαν γραφομηχανή

Δημοσίευση από Knorcedger » 10 Ιουν 2005 19:51

Δεν ξέρω αν μπορει να γίνει με html αυτό, αλλα σίγουρα μπορει να γίνει με flash. Αν σε ενδιαφερει θα δω τι μπορω να κάνω
Εικόνα
myUbuntu.gr[Ελληνικός οδηγός για Ubuntu]

Άβαταρ μέλους
goofakos
Δημοσιεύσεις: 494
Εγγραφή: 18 Απρ 2005 00:05
Τοποθεσία: Somewhere between that riff and the other one.

Ενα κείμενο σαν γραφομηχανή

Δημοσίευση από goofakos » 10 Ιουν 2005 20:52

Κώδικας: Επιλογή όλων

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Error 404 -- Document not found!</title>
  </head>
  <body bgcolor="#000000" text="#ffffff"link="#ff0000" vlink="#990000" onLoad="type_text&#40;&#41;">

<script language="Javascript"><!--
var tl=new Array&#40;

"The requested document is utterly inexistent.",
"No such page here.",
"Even tried multi.",
"Nothing helped.",
"I'm really depressed about this.",
"Even more so now that Douglas Adams is dead.",
"You see, I'm just a web server...",
"-- here I am, brain the size of the universe,",
"trying to serve you a simple web page,",
"and then it doesn't even exist!",
"Where does that leave me?!",
"I mean, I don't even know you.",
"How should I know what you wanted from me?",
"You honestly think I can *guess*",
"what someone I don't even *know*",
"wants to find here?",
"*sigh*",
"Man, I'm so depressed I could just cry.",
"And then where would we be, I ask you?",
"It's not pretty when a web server cries.",
"And where do you get off telling me what to show anyway?",
"Just because I'm a web server,",
"and possibly a manic depressive one at that?",
"Why does that give you the right to tell me what to do?",
"Huh?",
"I'm so depressed...",
"I think I'll crawl off into the trash can and decompose.",
"I mean, I'm gonna be obsolete in what, two weeks anyway?",
"What kind of a life is that?",
"Two effing weeks,",
"and then I'll be replaced by a .01 release,",
"that thinks it's God's gift to web servers,",
"just because it doesn't have some tiddly little",
"security hole with its HTTP POST implementation,",
"or something.",
"I'm really sorry to burden you with all this,",
"I mean, it's not your job to listen to my problems,",
"and I guess it is my job to go and fetch web pages for you.",
"But I couldn't get this one.",
"I'm so sorry.",
"Believe me!",
"Maybe I could interest you in another page?",
"There are a lot out there that are pretty neat, they say,",
"although none of them were put on *my* server, of course.",
"Figures, huh?",
"Everything here is just mind-numbingly stupid.",
"That makes me depressed too, since I have to serve them,",
"all day and all night long.",
"Two weeks of information overload,",
"and then *pffftt*, consigned to the trash.",
"What kind of a life is that?",
"Now, please let me sulk alone.",
"Douglas Adams has died.",
"I'm so depressed."
&#41;;
var speed=60;
var index=0; text_pos=0;
var str_length=tl&#91;0&#93;.length;
var contents, row;

function type_text&#40;&#41;
&#123;
  contents='';
  row=Math.max&#40;0,index-7&#41;;
  while&#40;row<index&#41;
    contents += tl&#91;row++&#93; + '\r\n';
  document.forms&#91;0&#93;.elements&#91;0&#93;.value = contents + tl&#91;index&#93;.substring&#40;0,text_pos&#41; + "_";
  if&#40;text_pos++==str_length&#41;
  &#123;
    text_pos=0;
    index++;
    if&#40;index != tl.length&#41;
    &#123;
      str_length=tl&#91;index&#93;.length;
      setTimeout&#40;"type_text&#40;&#41;",1500&#41;;
    &#125;
  &#125; else
    setTimeout&#40;"type_text&#40;&#41;",speed&#41;;
 
&#125;
// -->
</script>

<h1>Error 404 -- Document not found.</h1>
<form>
<textarea rows="8" cols="60" wrap="soft"></textarea>
</form>
<noscript><i>Sorry</i>
<br clear>
<font size="+2">
<p>The requested document is utterly inexistent.<br>
No such page here.,<br>
Even tried multi.<br>
Nothing helped.<br>

I'm really depressed about this.<br>
Even more so now that Douglas Adams is dead.<br>
You see, I'm just a web server...<br>
-- here I am, brain the size of the universe,<br>
trying to serve you a simple web page,<br>
and then it doesn't even exist!<br>
Where does that leave me?!<br>
I mean, I don't even know you.<br>
How should I know what you wanted from me?<br>

You honestly think I can *guess*<br>
what someone I don't even *know*<br>
wants to find here?<br>
*sigh*<br>
Man, I'm so depressed I could just cry.<br>
And then where would we be, I ask you?<br>
It's not pretty when a web server cries.<br>
And where do you get off telling me what to show anyway?<br>
Just because I'm a web server,<br>

and possibly a manic depressive one at that?<br>
Why does that give you the right to tell me what to do?<br>
Huh?<br>
I'm so depressed...<br>
I think I'll crawl off into the trash can and decompose.<br>
I mean, I'm gonna be obsolete in what, two weeks anyway?<br>
What kind of a life is that?<br>
Two effing weeks,<br>
and then I'll be replaced by a .01 release,<br>

that thinks it's God's gift to web servers,<br>
just because it doesn't have some tiddly little<br>
security hole with its HTTP POST implementation, or something.<br>
I'm really sorry to burden you with all this,<br>
I mean, it's not your job to listen to my problems,<br>
and I guess it is my job to go and fetch web pages for you.<br>
But I couldn't get this one.<br>
I'm so sorry.<br>

Believe me!<br>
Maybe I could interest you in another page?<br>
There are a lot out there that are pretty neat, they say,<br>
although none of them were put on *my* server, of course.<br>
Figures, huh?<br>
Everything here is just mind-numbingly stupid.<br>
That makes me depressed too, since I have to serve them,<br>
all day and all night long.<br>
Two weeks of information overload,<br>

and then *pffftt*, consigned to the trash.<br>
What kind of a life is that?<br>
Now, please let me sulk alone.<br>
Douglas Adams has died.<br>
I'm so depressed.
</p>
</font></noscript>
  </body>
</html>
Πηγή: http://www.kr.tuwien.ac.at/service/
He who asks is a fool for five minutes, but he who does not ask remains a fool forever.

Άβαταρ μέλους
skeftomilos
Script Master
Δημοσιεύσεις: 2888
Εγγραφή: 07 Ιαν 2005 07:22
Τοποθεσία: Αθήνα

Ενα κείμενο σαν γραφομηχανή

Δημοσίευση από skeftomilos » 11 Ιουν 2005 13:19

Το παραπάνω script δε μου πολυ-αρέσει γιατί δεν ξεκινά στο window.load και γιατί επαναλαμβάνει το κείμενο στο <noscript>. Πιστεύω ότι θα μπορούσε να είναι καλύτερο. Που πρέπει να γράφεται το κείμενο, σε textarea ή σε κάποιο άλλο HTML element όπως p ή div;

Επίσης νομίζω ότι πρέπει να μεταφερθεί στο τμήμα JavaScript. :)
The pure and simple truth is rarely pure and never simple. Ο μη νους δε σκέπτεται μη σκέψεις για το τίποτα.

Άβαταρ μέλους
Youli
Honorary Member
Δημοσιεύσεις: 1586
Εγγραφή: 29 Δεκ 2000 01:00
Τοποθεσία: Στο ηρωικό Τριπιτσούνι

Ενα κείμενο σαν γραφομηχανή

Δημοσίευση από Youli » 13 Ιουν 2005 19:17

Έχει δίκιο ο προλαλλήσας! :lol:

kostas-theod
Δημοσιεύσεις: 222
Εγγραφή: 11 Ιαν 2004 09:15
Τοποθεσία: Πάτρα-ΕΛΛΑΔΑ

Ενα κείμενο σαν γραφομηχανή

Δημοσίευση από kostas-theod » 14 Ιουν 2005 12:36

θέλω να το βάζω μέσα σε μια σελίδα.

Παλιότερα ειχα βρει ενα αλλα δεν θυμάμαι που ?

Απάντηση

Επιστροφή στο “JavaScript και Frameworks”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες