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脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++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技

如何利用JavaScript和WebSocket實現即時線上點餐系統介紹:隨著網路的普及和技術的進步,越來越多的餐廳開始提供線上點餐服務。為了實現即時線上點餐系統,我們可以利用JavaScript和WebSocket技術。 WebSocket是一種基於TCP協定的全雙工通訊協議,可實現客戶端與伺服器的即時雙向通訊。在即時線上點餐系統中,當使用者選擇菜餚並下訂單

如何使用WebSocket和JavaScript實現線上預約系統在當今數位化的時代,越來越多的業務和服務都需要提供線上預約功能。而實現一個高效、即時的線上預約系統是至關重要的。本文將介紹如何使用WebSocket和JavaScript來實作一個線上預約系統,並提供具體的程式碼範例。一、什麼是WebSocketWebSocket是一種在單一TCP連線上進行全雙工

JavaScript和WebSocket:打造高效的即時天氣預報系統引言:如今,天氣預報的準確性對於日常生活以及決策制定具有重要意義。隨著技術的發展,我們可以透過即時獲取天氣數據來提供更準確可靠的天氣預報。在本文中,我們將學習如何使用JavaScript和WebSocket技術,來建立一個高效的即時天氣預報系統。本文將透過具體的程式碼範例來展示實現的過程。 We

JavaScript教學:如何取得HTTP狀態碼,需要具體程式碼範例前言:在Web開發中,經常會涉及到與伺服器進行資料互動的場景。在與伺服器進行通訊時,我們經常需要取得傳回的HTTP狀態碼來判斷操作是否成功,並根據不同的狀態碼來進行對應的處理。本篇文章將教你如何使用JavaScript來取得HTTP狀態碼,並提供一些實用的程式碼範例。使用XMLHttpRequest

用法:在JavaScript中,insertBefore()方法用於在DOM樹中插入一個新的節點。這個方法需要兩個參數:要插入的新節點和參考節點(即新節點將要插入的位置的節點)。

JavaScript是一種廣泛應用於Web開發的程式語言,而WebSocket則是一種用於即時通訊的網路協定。結合二者的強大功能,我們可以打造一個高效率的即時影像處理系統。本文將介紹如何利用JavaScript和WebSocket來實作這個系統,並提供具體的程式碼範例。首先,我們需要明確指出即時影像處理系統的需求和目標。假設我們有一個攝影機設備,可以擷取即時的影像數
