文本框中循环移动的文字.htm
来自「VBSCRIPT的源码,相信很多html程序员都会用到,这些源码小小变动一下,可」· HTM 代码 · 共 33 行
HTM
33 行
<html>
<body onLoad="scroll_text()" bgColor=peachpuff>
<form name=myform >
<input name=display size=50 value="我是一个大帅哥" >
</form>
<script LANGUAGE="VBScript"><!--
'根据屏幕解析决定走马灯文字前后之间中文空白个数
if screen.width = 640 then
spaces = 20
elseif screen.width = 800 then
spaces = 25
else
spaces = 32
end if
'产生 spaces 个中文全型空白
text = ""
for i = 1 to spaces
text = text & " "
next
text = text & "我是一个大帅哥"
Sub scroll_text()
document.myform.display.value = text
text = Mid(text,2) & Left(text,1) '将 text最左边一个字调到最右边
setTimeout "scroll_text()",500 '每 0.5 秒卷动 1 个字
End Sub
-->
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?