JavaScript模拟打字效果
JavaScript可以模拟打字效果,很有创意的一个小脚本,可以用作404页面,当然也可以用在很多地方。先把需要打印的字符串预先保存到一个数组当中,然后利用setTimeout()方法每个一小段时间输出一个字符,连串起来就像打字一样的效果。
Code
<script type="text/javascript"> <!-- var tl = new Array( "I am so sorry, but I can't find the Page you've requested.", "It's possible that you entered the address incorrectly.", "If you did enter the address correctly, then it must be my fault.", "I am really, really sorry, but I've tried everything I know to find it.", "Nothing helped.", "I am really depressed about this.", "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?", "", "Maybe I should introduce myself... my name is Marvin.", "But then again, what is the use of intruducing myself?", "You can't tell me your name, because you are in some far off place, sitting in front of your computer.", "And that makes me feel lonely.", "Do you know what that is like?", "", "...sigh...", "", "Man, I am 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?", "I'm just a web server...", "...and possibly a manic depressive one at that...", "So why does that give you the right to tell me what to do?", "Huh?", "", "I am 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 like that.", "", "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 am 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?", "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.", "Again I ask you, what kind of a life is that?", "", "Now, please let me sulk alone.", "", "", "", "", "I am so depressed.", "", "", "", "", "", "", "", "<connection terminated>" ); var speed = 50; var index = 0; text_pos = 0; var str_length = tl[0].length; var contents, row; function type_text() { contents=''; row = Math.max(0,index-7); while(row < index) { contents += tl[row++] + '\r\n'; } //document.forms[0].elements[0].value = contents + tl[index].substring(0,text_pos) + "_"; document.getElementById("typearea").value = contents + tl[index].substring(0,text_pos) + "_"; if(text_pos++==str_length) { text_pos=0; index++; if(index!=tl.length) { str_length=tl[index].length; setTimeout("type_text()",1500); } } else setTimeout("type_text()",speed); } //--> </script> <form> <textarea id="typearea" rows="20" cols="100" style="font-family:Arial; font-size:14px; "></textarea> </form> <script type="text/javascript">type_text();</script>

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

如何使用WebSocket和JavaScript实现在线语音识别系统引言:随着科技的不断发展,语音识别技术已经成为了人工智能领域的重要组成部分。而基于WebSocket和JavaScript实现的在线语音识别系统,具备了低延迟、实时性和跨平台的特点,成为了一种被广泛应用的解决方案。本文将介绍如何使用WebSocket和JavaScript来实现在线语音识别系

WebSocket与JavaScript:实现实时监控系统的关键技术引言:随着互联网技术的快速发展,实时监控系统在各个领域中得到了广泛的应用。而实现实时监控的关键技术之一就是WebSocket与JavaScript的结合使用。本文将介绍WebSocket与JavaScript在实时监控系统中的应用,并给出代码示例,详细解释其实现原理。一、WebSocket技

如何使用WebSocket和JavaScript实现在线预约系统在当今数字化的时代,越来越多的业务和服务都需要提供在线预约功能。而实现一个高效、实时的在线预约系统是至关重要的。本文将介绍如何使用WebSocket和JavaScript来实现一个在线预约系统,并提供具体的代码示例。一、什么是WebSocketWebSocket是一种在单个TCP连接上进行全双工

如何利用JavaScript和WebSocket实现实时在线点餐系统介绍:随着互联网的普及和技术的进步,越来越多的餐厅开始提供在线点餐服务。为了实现实时在线点餐系统,我们可以利用JavaScript和WebSocket技术。WebSocket是一种基于TCP协议的全双工通信协议,可以实现客户端与服务器的实时双向通信。在实时在线点餐系统中,当用户选择菜品并下单

JavaScript教程:如何获取HTTP状态码,需要具体代码示例前言:在Web开发中,经常会涉及到与服务器进行数据交互的场景。在与服务器进行通信时,我们经常需要获取返回的HTTP状态码来判断操作是否成功,根据不同的状态码来进行相应的处理。本篇文章将教你如何使用JavaScript获取HTTP状态码,并提供一些实用的代码示例。使用XMLHttpRequest

JavaScript和WebSocket:打造高效的实时天气预报系统引言:如今,天气预报的准确性对于日常生活以及决策制定具有重要意义。随着技术的发展,我们可以通过实时获取天气数据来提供更准确可靠的天气预报。在本文中,我们将学习如何使用JavaScript和WebSocket技术,来构建一个高效的实时天气预报系统。本文将通过具体的代码示例来展示实现的过程。We

JavaScript中的HTTP状态码获取方法简介:在进行前端开发中,我们常常需要处理与后端接口的交互,而HTTP状态码就是其中非常重要的一部分。了解和获取HTTP状态码有助于我们更好地处理接口返回的数据。本文将介绍使用JavaScript获取HTTP状态码的方法,并提供具体代码示例。一、什么是HTTP状态码HTTP状态码是指当浏览器向服务器发起请求时,服务

用法:在JavaScript中,insertBefore()方法用于在DOM树中插入一个新的节点。这个方法需要两个参数:要插入的新节点和参考节点(即新节点将要被插入的位置的节点)。
