80.html

来自「javescript网页特效80个例子」· HTML 代码 · 共 48 行

HTML
48
字号
<html>
<head>
<title>状态栏中文字左右移动</title>
</head>
<body>
<script language="Javascript">
<!--
var x = 0
var speed = 90  //设置移动速度
var text = "向右走,向左走,真不知道到底往哪? : ("  //设置显示内容
var course = 120
var text2 = text

function Scroll() {
window.status = text2.substring(0, text2.length)

if (course < text2.length) {
setTimeout("Scroll2()", speed)
}

else {
text2 = " " + text2

setTimeout("Scroll()", speed);
}
}

function Scroll2() {
window.status = text2.substring(x, text2.length)

if (text2.length - x == text.length) { 
text2 = text
x = 0

setTimeout("Scroll()", speed);
}

else {
x++
setTimeout("Scroll2()", speed);
}
}

Scroll()
//-->
</script>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?