Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Nút nhấn » Chữ xuất hiện ngẫu nhiên trong khung
URL: https://www.javascriptbank.com/chaosticker.html
Hiệu ứng tạo ra một hộp thoại chứa các thông tin được cho xuất hiện bằng cách cho hiển thị ngẫu nhiên các kí tự cho đến khi thu được câu hoàn chỉnh.
Phiên bản đầy đủ: jsB@nk » Biểu mẫu » Nút nhấn » Chữ xuất hiện ngẫu nhiên trong khung
URL: https://www.javascriptbank.com/chaosticker.html
<SCRIPT language=javaScript><!-- Beginning of JavaScript -// ChaosTicker// CONFIGURATION:// 1.Delete the DIV-block with the id "deletethisblock". You don't need it.// 2. Configure messages and speed inside the head-section of the script.// Configure your messages. You may add as many messages as you like.var message = new Array()message[0]="This newsticker orders randomly arranged letters ..."message[1]="... until a readable message appears ... "message[2]=".. out of the chaos."message[3]="Try this little magic on your web site."message[4]="And have fun!"// Configure the standstill-time between the messages (milliseconds).var standstill=2000// Do not edit the variables belowvar i_substring=0var i_message=0var i_letter=0var messagelengthvar content_corrcet=""var content_chaos=""var randomorder=new Array()for (i=0;i<=200;i++) {randomorder[i]=i}function getrandomorder(range) {for (i=0;i<=200;i++) {randomorder[i]=i}for (i=0;i<=range;i++) {var firstvalue= Math.floor(range*Math.random())var secondvalue= Math.floor(range*Math.random())var cachevalue=randomorder[firstvalue]randomorder[firstvalue]=randomorder[secondvalue]randomorder[secondvalue]=cachevalue}}function makechaos() {messagelength=message[i_message].length-1getrandomorder(messagelength)content_correct=message[i_message]content_chaos=""for (i=0;i<=message[i_message].length-1;i++) {content_chaos+=content_correct.substring(randomorder[i],randomorder[i]+1)}document.order.thismessage.value=content_chaosmakecorrcet()}function makecorrcet() {if (i_letter<=messagelength) {var front_chaos=content_chaos.substring(0,randomorder[i_letter])var letter=content_correct.substring(randomorder[i_letter],randomorder[i_letter]+1)var back_chaos=content_chaos.substring(randomorder[i_letter]+1,messagelength)content_chaos=front_chaos+letter+back_chaosdocument.order.thismessage.value=content_chaosi_letter++var timer=setTimeout("makecorrcet()",30)}else {clearTimeout(timer)i_letter=0var timer=setTimeout("changemessage()", standstill)}}function changemessage() {i_message++if (i_message>message.length-1) {i_message=0}makechaos()}// - End of JavaScript - --></SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<BODY onload=makechaos()><FORM name=order><INPUT name=thismessage size=55 style="BACKGROUND-COLOR: #ffffcc; COLOR: red; FONT-FAMILY: Courier; FONT-SIZE: 9pt; FONT-WEIGHT: bold"> </FORM></BODY><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->