会自动逐行上升的文本框

- 中国WEB开发者网络 (http://www.webasp.net)
-- 网页特效 (http://www.webasp.net/javascript/)
--- 会自动逐行上升的文本框 (http://www.webasp.net/javascript/1/396.htm)
-- 发布日期: 2005-06-07
<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 3 个步骤: -->

<!-- 第 1 步: -->
<!-- 把下面的代码加到<HEAD></HEAD>区域中: -->

<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;
// change the speed below: 1000 = 1 second.
setTimeout("selectScroller("+n+")",2000);
}
// End -->
</script>





<!-- 第 2 步: -->
<!-- 把<BODY>中的属性代码改为: -->

<BODY OnLoad="selectScroller(0);">



<!-- 第 3 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<center>
<form name="scrollform">
<select name="scroller" size=8>
<option>
<option>
<option>
<option>
<option>
<option>
<option>
<option>
<option>This select option list will
<option>scroll text by copying
<option>the top line to the bottom
<option>line before deleting the
<option>top line. This moves the
<option>options up one line and
<option>gives the impression of
<option>scrolling.
<option>
<option>You can leave as many
<option>blank lines as you feel
<option>necessary to give the
<option>look of begining and
<option>ending.
<option>
<option>This script was written
<option>in response to those
<option>who wanted a news
<option>scroller to work within
<option>a table's cell and for
<option>those who want old
<option>browsers to also see
<option>a scoller on the page.
<option>
<option>
</select>
</form>
</center>


webasp.net