?? 3.36 文字的垂直滾動.htm
字號:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>標題頁</title>
<script language="JavaScript">
done = 0; //判斷是否滾動
step = 4; //滾動的步長
function anim(yp,yk) //實現垂直滾動的方法
{
if(document.layers) document.layers["divtxt"].top=yp; //netscape瀏覽器下
else document.all["divtxt"].style.top=yp; //指定文本的y坐標
if(yp>yk) step = -4 //如果已經到底部,則開始向上移動
if(yp<60) step = 4 //如果已經到頂部,則開始向下移動
setTimeout('anim('+(yp+step)+','+yk+')', 35); //循環執行滾動方法
}
function start()
{
if(done) return
done = 1;
if(navigator.appName=="Netscape") {
document.divtxt.left=innerWidth/2 - 145;
anim(60,innerHeight - 60)
}
else
{
divtxt.style.left=11; //設置文本的x坐標
anim(60,document.body.offsetHeight - 60) //調用垂直滾動的方法
}
}
</script>
<div id="divtxt" style="position: absolute;top: -50;color: #000000;font-family:宋體;font-size:9pt;">
<p><font color=blue>文字垂直滾動的特效演示</font>
</p></div>
<script language="JavaScript">
setTimeout('start()',10); //循環執行start方法
</script>
</head>
<body>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -