📄 31.htm
字号:
<html>
<head>
<title>反弹文字</title>
<script language="javascript">
<!--
x = 0;
y = 0;
controlx = true;
controly = true;
function moveText(){
docWidth = parseInt(document.body.clientWidth);
docHeight = parseInt(document.body.clientHeight)-20;
textWidth = parseInt(txt.style.width);
txt.style.left = x;
txt.style.top = y;
if(controlx && docWidth-textWidth > x){
x+=2;
}else{
controlx = false;
}
if(!controlx && x > 0){
x-=2;
}else{
controlx = true;
}
if(controly && docHeight > y){
y+=2;
}else{
controly = false;
}
if(!controly && y > 0){
y-=2;
}else{
controly = true;
}
setTimeout("moveText()",1);
}
//-->
</script>
</head>
<body onLoad="moveText()">
<div id="txt" style="position:absolute;width=65">反弹文字</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -