电脑安全

您当前的位置:主页 > 电脑安全 >

可以文本显示的公告栏-网络编程

来源:[db:来源]标题:   为你    编辑:电脑技术全能网 时间:2019-09-20 06:24

原标题:可以文本显示的公告栏-网络编程
   一个能够文本表现的布告栏,能够在多处应用,相对弗成错过! 剧本阐明: 第一步:把以下代码参加<head>地区中 <script language="JavaScript"> <!-- Activate Cloaking Device var i = 0; // used to cycle thru messages var TextNumber = -1; // 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; // used to display message number var message=0; // used to position text in ver 2.0 var addPadding="rn"; // Each element of TextInput represents a single message. TextInput[0] = "明天留神了有新的义务安排"; TextInput[1] = "欢送你的光顾!本站为你供给大批javascript下载"; TextInput[2] = "重点先容Javascript"; TextInput[3] = "与制造网页殊效紧密相干的技巧"; TextInput[4] = "本站同时有影音空间等栏目"; TextInput[5] = "另有消息及安康方面的材料"; TextInput[6] = "另有宽带网方面的大批技巧文章"; TextInput[7] = "本站网址:http://www.njcatv.net"; 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];} var TimerId var TimerSet=false; // Called by >>> button (display next message) . function nextMessage() { if (!TimerSet) { TimerSet=true; clearTimeout (TimerId); if (TextNumber>=TotalTextInput) { alert("This is the end of the list!"); TimerSet=false; }