没有公告
加入收藏
设为首页
联系站长
|
首页
|
菜鸟学堂
|
软件应用
|
硬件知识
|
操作系统
|
网络安全
|
网页制作
|
图形图像
|
产业咨讯
|
知识问答
|
轻松学电脑
>>
网页制作
>>
文本特效类
>>自由控制文字输入
双击滚屏阅读
自由控制文字输入
自由控制文字输入
下面为效果显示区!
点开始键文字自动显示
脚本说明: 第一步:把如下代码加入<body>区域中 <SCRIPT> <!-- Activate Cloaking Device // used to track position in message var i = 0; // used to cycle thru messages var TextNumber = 0; // array of messages var TextInput = new Object(); // used to load manipulate message var HelpText=""; // used to load message var Text = ""; // length of timeout (smaller is faster) var Speed=50; // added to end of each message to create a pause var WaitSpace=" " // used to position text in ver 2.0 var addPadding="\r\n"; // Each element of TextInput represents a single message. TextInput[0] = "This is just another method of displaying information to your visitors."; TextInput[1] = "The routine is based on the T-Banner by Tomer and Yehuda Shiran."; TextInput[2] = "I've selected the TextArea for display to utilize the wrap-around feature."; TextInput[3] = "The messages can be made to cycle manually, check out Tele-Type 1 in Tim's Lab."; TextInput[4] = "Though this scheme is not perfect, you have to admit it is different!"; TextInput[5] = "I've learned that you can reduce flicker by shortening the messages."; TextInput[6] = "One may want to add speed adjustment to better match individual machines."; TextInput[7] = "Whether practical or not, at least it was fun developing Timothy's Tele-Type Display!"; TotalTextInput = 7; // (0, 1, 2, 3, 4, 5, 6, 7) // Positioning and speed vary between versions. var Version = navigator.appVersion; if (Version.substring(0, 1)==3) { Speed=200; addPadding=""; } for (var addPause = 0; addPause <= TotalTextInput; addPause++) {TextInput[addPause]=addPadding+TextInput[addPause]+WaitSpace;} var TimerId var TimerSet=false; // Called by the Start button. function startMessage() { if (!TimerSet) { TimerSet=true; teletype(); } } // Gets and displays character from rollMessage() . // Variable Speed controls length of timeout and thus the speed of typing. function teletype() { Text=rollMessage(); TimerId = setTimeout("teletype()", Speed) document.forms[0].elements[0].value=Text; } // Pulls one character at a time from string and returns (as Text) to function teletype() for displaying. function rollMessage () { Wait_yn=false; i++; var CheckSpace = HelpText.substring(i-1, i); CheckSpace = "" + CheckSpace; if (CheckSpace == " ") {i++;} if (i >= HelpText.length+1) { i=0; if (TextNumber < TotalTextInput) {TextNumber++;} else {TextNumber = 0;} initMessage(); } Text = HelpText.substring(0, i); return (Text); } // Called from onLoad in BODY tag & resetDisplay(). function titleDisplay() { document.forms[0].elements[0].value="\r\n AutoCycle Tele-Type Display"; initMessage(); } // Sets Text & HelpText equal to messages for use in rollMessage (). function initMessage() { Text = TextInput[TextNumber] HelpText = Text; } // Called by Stop button. function stopMessage() { TimerSet=false; clearTimeout (TimerId); } // Called by Reset button. function resetDisplay() { TimerSet=false; clearTimeout (TimerId); TextNumber=0; i=0; titleDisplay(); } // Deactivate Cloaking --> </SCRIPT> <form> <TEXTAREA ROWS=2 COLS=55 wrap=yes></TEXTAREA> <BR> <TABLE BORDER=0 WIDTH=300> <TD align="center"><INPUT TYPE="button" VALUE="Start" onClick="startMessage()"> <TD align="center"><INPUT TYPE="button" VALUE="Reset" onClick="resetDisplay()"> <TD align="center"><INPUT TYPE="button" VALUE="Stop" onClick="stopMessage()"> </TABLE> 第二步:把如下代码加入<body>区域中 <body bgcolor="#fef4d9" onLoad="titleDisplay()">
上一篇文章:
逐字出现的信息条
下一篇文章:
一段彩色的文字
广告
阅读top10
文字弯曲变形
文字向左移动
按钮驱动文字闪烁
文字胡乱跳动
链接在右面打开
状态栏条
点击出现链接
文字连续闪烁
文字段任意移动
点击改变文字
文字逐个闪烁
各种形式文字输出
文字飘动输出
调节文字移动形式
查看
自由控制文字输入
全部内容
|
设为首页
|
加入收藏
|
联系站长
|
友情链接
|
版权申明
| |
本站提供:
电脑教程
网页制作
Flash教程
PhotoShop教程
等免费教程。
Copyright © 2006-2008
轻松学电脑
All Rights Reserved