📄 8-3.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>movebypath</title>
</head>
<script language="JavaScript">
var winWidth,winHeight,theLeft,theTop,theImg;
var xFlag = 1,yFlag = 1;
var xStep = 2,yStep = 1;
function movePic()
{
ifNN4=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==4);
ifNN6=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==5);
if(ifNN4)
theImg = document.img1;
else
theImg = document.getElementById("img1").style;
if(ifNN4||ifNN6)
{
winWidth = window.innerWidth;
winHeight = window.innerHeight;
}
else
{
winWidth = document.body.clientWidth;
winHeight = document.body.clientHeight;
}
theLeft = parseInt(theImg.left);
theTop = parseInt(theImg.top);
if(theLeft<=0)
xFlag = 1;
if(theLeft+120>=winWidth)
xFlag = -1;
if(theTop<=0)
yFlag = 1;
if(theTop+60>=winHeight)
yFlag = -1;
theImg.left = theLeft+xFlag*xStep;
theImg.top = theTop+yFlag*yStep;
setTimeout("movePic()",50);
}
</script>
<body onload="movePic()">
<div id="img1" style="position:absolute;left:0px;top:0px;width=120px;height=60px;z-index:2">
<a href="10-2.html"><img border="0" src="pic1.gif"></a>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -