Introduction | Special Effects | Web page
When we pay attention to the Internet is often the content of the site page, and the status bar will not be too much attention, if we give the status of the page to add some special effects, will certainly make your site add a landscape, the following gives you 7 common status bar effects of the JavaScript code.
Effect One: Scrolling display
The first step: Add the following code to the area
<script language= "Javascript" <!-- function Scrollit (seed) { var m1 = "Hi: Hello!"; var m2 = "Welcome to Sadie"; var m3 = "Please advise more, thank you!"; var m4 = "You are welcome to come again next time!" "; var m5 = "Http://www.ccidnet.com"; Var msg=m1+m2+m3+m4+m5; var out = ""; var c = 1; if (Seed >) { seed-- Cmd= "Scrollit (" +seed+ ")"; Timertwo=window.settimeout (cmd,100); } Else if (seed <= && seed > 0) { for (c=0 C < seed; c) { out+= ""; } Out+=msg; seed--; Window.status=out; cmd= "Scrollit" ("+seed+"); Timertwo=window.settimeout (cmd,100); } Else if (seed <= 0) { if (-seed < msg.length) { out+=msg.substring (-seed,msg.length); seed--; Window.status=out; cmd= "Scrollit" ("+seed+"); Timertwo=window.settimeout (cmd,100); } Else { window.status= ""; Timertwo=window.settimeout ("Scrollit (100)", 75); } } } //--> </script> |
Step Two: add the following code to the <body> area
<body background=bag.gif > |
Special effects Two: text from the right side of the status bar in the Loop pop-up
Add the following code to the area
<script language= "Javascript" > var message = "Welcome to the Sadie Network, please give more comments." Thank you! " var POSITION = 150 var DELAY = 10 var scroll = new Statusmessageobject () function Statusmessageobject (p,d) { THIS.MSG = Message This.out = "" This.pos = POSITION This.delay = delay THIS.I = 0 This.reset = Clearmessage} function Clearmessage () { This.pos = POSITION} function Scroller () { for (scroll.i = 0; scroll.i < Scroll.pos; scroll.i++) { Scroll.out = ""} if (scroll.pos >= 0) Scroll.out + + scroll.msg else Scroll.out = scroll.msg.substring (-scroll.pos,scroll.msg.length) Window.status = Scroll.out Scroll.out = "" scroll.pos-- if (Scroll.pos <-(scroll.msg.length)) { Scroll.reset ()} SetTimeout (' scroller () ', Scroll.delay)} Function Snapin (jumpspaces,position) { var msg = scroll.msg var out = "" for (var i=0; i<position; i++) {out = = Msg.charat (i)} for (i=1;i<jumpspaces;i++) {out = = ""} Out + = Msg.charat (position) Window.status = out if (jumpspaces <= 1) { position++ if (Msg.charat (position) = = ") {position++} Jumpspaces = 100-position else if (Jumpspaces > 3) {jumpspaces *=. 75} Else {jumpspaces--} if (position!= msg.length) { var cmd = "Snapin (" + Jumpspaces + "," + position + ")"; Scrollid = Window.settimeout (Cmd,scroll.delay); } else {window.status= "" Jumpspaces=0 Position=0 cmd = "Snapin" ("+ Jumpspaces +", "+ position +") "; Scrollid = Window.settimeout (Cmd,scroll.delay); return False} return true} Snapin (100,0); </script> |
Effects three: Title pop-up effect
Add the following code to the area
<script language= "JavaScript" > <!--Hide Me var index_count = 0; var title_string = "Welcome to Sadie Net, (http://www.ccidnet.com) There are many articles on computer applications here. , is a good place for you to learn computer! I hope you can come often! "; var title_length = title_string.length; var Cmon; var kill_length = 0; function Loopthescroll () { Scrollthetitle (); if (Kill_length > Title_length) { Cleartimeout (Cmon); } kill_length++; Cmon = settimeout ("Loopthescroll ();", 100) } function Scrollthetitle () { var doc_title = title_string.substring ((title_length-index_count-1), title_length); Document.title = Doc_title; index_count++; } Loopthescroll (); --> </script> |
Effect Four: Text combination pop-up
The first step: Add the following code to the area
<script language= "JavaScript" > <!--Hide This script from the old browsers- var speed = 10 var pause = 1500 var Timerid = null var bannerrunning = False var ar = new Array () Ar[0] = "Welcome to Sadie Net!" " AR[1] = "It is a good helper of your school computer!" " AR[2] = "Please give more comments, thank you!" var message = 0 var state = "" Clearstate () function Stopbanner () { if (bannerrunning) Cleartimeout (Timerid) Bannerrunning = False } function Startbanner () { Stopbanner () Showbanner () } function Clearstate () { State = "" for (var i = 0; i < ar[message].length; ++i) { state = = "0" } } function Showbanner () { if (getString ()) { message++ if (ar.length <= message) Message = 0 Clearstate () Timerid = settimeout ("Showbanner ()", pause) Bannerrunning = True } else { var str = "" for (var j = 0; j < state.length; ++j) { str = (State.charat (j) = = "1")? Ar[message].charat (j): "" } Window.status = str Timerid = settimeout ("Showbanner ()", speed) Bannerrunning = True } } function getString () { var full = True for (var j = 0; j < state.length; ++j) { if (State.charat (j) = = 0) Full = False } if (full) return True while (1) { var num = getrandom (ar[message].length) if (State.charat (num) = "0") Break } State = state.substring (0, num) + "1" + state.substring (num + 1, state.length) return False } function Getrandom (max) { Return Math.Round ((max-1) * Math.random ()) } ---end hiding here--> </script> |
Step Two: add the following code to the <body> area
<body bgcolor= "#fef4d9" > |
Special effects Five: the text keeps flashing
The first step: Add the following code to the area
<script language= "" > <!-- var yourwords = "Welcome to Sadie Network (http://www.ccidnet.com)!!!"; var speed = 700; var control = 1; function Flash () { if (Control = = 1) { Window.status=yourwords; control=0; } Else { Window.status= ""; control=1; } SetTimeout ("Flash ()", speed); } --> </script> |
Step Two: add the following code to the <body> area
<body bgcolor= "#fef4d9" > |
Special Effects VI: Text appears back and forth
The first step: Add the following code to the area
<script language= "Javascript" > <!--Begin var message= "Welcome to Sadie Network (http://www.ccidnet.com)!!!!!"; var place=1; function Scrollin () { Window.status=message.substring (0, place); if (place >= message.length) { place=1; Window.settimeout ("Scrollout ()", 300); } else { place++; Window.settimeout ("Scrollin ()", 50); } } function Scrollout () { Window.status=message.substring (place, message.length); if (place >= message.length) { place=1; Window.settimeout ("Scrollin ()", 100); } else { place++; Window.settimeout ("Scrollout ()", 50); } } End--> </script> |
Step Two: change the contents of <body> to:
<body bgcolor= "#fef4d9" > |
Special Effects VII: status bar fixed information
<body bgcolor= "#fef4d9" > |