📄 829text2.htm
字号:
<html>
<head>
<title>文字段任意移动</title>
<style type="text/css">
<!--
body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 4px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
--></style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#fef4d9">
<br>
<center><font color=red face="隶书" size=6>文字段任意移动</font></center>
<br>
<center>
<table border=5 bordercolor=blue borderlight=green>
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区</strong></font></td></tr>
<tr><td align=center height=80 width=300>
<SCRIPT LANGUAGE="JAVASCRIPT">
n = (document.layers) ? 1:0
ie = (document.all) ? 1:0
function move(newleft, newtop) {
if (n) {
document.layer1.left = newleft;
document.layer1.top = newtop;
}
if (ie) {
layer1.style.left = newleft;
layer1.style.top = newtop;
}
}
function moveby(left, top) {
if (n) {
document.layer1.left = document.layer1.left + left;
document.layer1.top = document.layer1.top + top;
}
if (ie) {
layer1.style.left= layer1.style.pixelLeft + left;
layer1.style.top = layer1.style.pixelTop + top;
}
}
</SCRIPT>
<A HREF="#" onClick="move(300,300)">Move(300,300)</A><BR>
<A HREF="#" onClick="move(300,100)">Move(300,100)</A><BR>
<A HREF="#" onClick="move(100,300)">Move(100,300)</A><BR>
<A HREF="#" onClick="moveby(20,20)">Moveby(20,20)</A><BR>
<A HREF="#" onClick="moveby(10,20)">Moveby(10,20)</A><BR>
<A HREF="#" onClick="moveby(20,-10)">Moveby(20,-10)</A><BR>
<DIV ID="layer1" STYLE="position:absolute; top:250; left:350; visibility:visible width=300">
可移动的文字段
</DIV>
</td></tr></table></center>
<br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<center>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide
function goHist(a)
{
history.go(a);
}
//-->
</script>
<FORM METHOD="post">
<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" style="background-color: #8000FF; color: rgb(255,255,255)">
</form>
</center>
<br>
<center>
<textarea name=source rows=12 cols=55 class=yk9>
脚本说明:
把如下代码加入<body>区域中:
<SCRIPT LANGUAGE="JAVASCRIPT">
n = (document.layers) ? 1:0
ie = (document.all) ? 1:0
function move(newleft, newtop) {
if (n) {
document.layer1.left = newleft;
document.layer1.top = newtop;
}
if (ie) {
layer1.style.left = newleft;
layer1.style.top = newtop;
}
}
function moveby(left, top) {
if (n) {
document.layer1.left = document.layer1.left + left;
document.layer1.top = document.layer1.top + top;
}
if (ie) {
layer1.style.left= layer1.style.pixelLeft + left;
layer1.style.top = layer1.style.pixelTop + top;
}
}
</SCRIPT>
<A HREF="#" onClick="move(300,300)">Move(300,300)</A><BR>
<A HREF="#" onClick="move(300,100)">Move(300,100)</A><BR>
<A HREF="#" onClick="move(100,300)">Move(100,300)</A><BR>
<A HREF="#" onClick="moveby(20,20)">Moveby(20,20)</A><BR>
<A HREF="#" onClick="moveby(10,20)">Moveby(10,20)</A><BR>
<A HREF="#" onClick="moveby(20,-10)">Moveby(20,-10)</A><BR>
<DIV ID="layer1" STYLE="position:absolute; top:100; left:200; visibility:visible">
This is a layer called "layer1"<BR>
</DIV>
</textarea>
<br>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -