Javascript| Program
On some pages, we often see some scrolling text, cool, how to do it?
Below we take Xu Zhimo's one "again Kangqiao" as an example, uses the JavaScript to write a program, realizes the text to scroll.
1. Run the Dreamweaver application and click the "Show Code View and Design View" button in the toolbar.
In the Open Code window, insert the following section of code into the < head> area.
< SCRIPT language= "JavaScript" >
<!--Begin
function Selectscroller (n) {
Optlist = Document.scrollform.scroller;
Optlist[optlist.length] = new Option (Optlist[0].text, "", false, false);
OPTLIST[0] = null;
Optlist.selectedindex =-1;
n = (n + 1)% Optlist.length;
settimeout ("Selectscroller" ("+n+") ", 2000);
}</p>
</script>
This code is designed to control the speed at which text is played.
2. Add the following code to the area
< form name= "Scrollform" >
< select Name= "Scroller" size=8>
< option> softly I'm gone,
< option> as softly as I come;
< option> I waved softly,
< option> the clouds in the western paradise.
< option>
< The golden willow of the river Option>,
......
< option> quietly I'm gone,
< option> as I come quietly;
< option> I waved my sleeve,
< option> not take away a cloud.
This program is designed to control the size of the text box and to display the scrolling text content.
3. Change the < body> to
< BODY >
After embedding the above code, press the F12 key to view the effect.