📄 8-1.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>picmove</title>
<META http-equiv="content-type" CONTENT="text/html;charset=gb2312">
<META NAME="Author" CONTENT="CZH;czh44@sohu.com">
</head>
<script>
theX=0;
theY=0;
to=0;
le=0;
step=9;
inter=100;
ifNN4=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==4);
ifNN6=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==5);
function movePic()
{
var layImg=(ifNN4)?document.layImg:document.getElementById('layImg').style;
if(theX-le>-30||theX-le<-40)
{
le+=step*((theX-le>-30)?1:-1);
layImg.left=le;
}
if(theY-to>80||theY-to<70)
{
to+=step*((theY-to>80)?1:-1);
layImg.top=to;
}
setTimeout('movePic()',inter);
}
function getPos(e)
{
if(ifNN4||ifNN6)
{
theX=e.pageX;
theY=e.pageY;
}
else
{
theX=document.body.scrollLeft+event.clientX;
theY=document.body.scrollTop+event.clientY;
}
}
if(ifNN4||ifNN6)
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=getPos;
</script>
<body onload="movePic()">
<div id="layImg" style="position:absolute;z-index:10">
<img src="pic1.gif" alt="study in Canada">
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -