<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<div id="img" style="position:absolute;; width: 100; height: 80">
<img src="./test.jpg" border="0">
<DIV style="FONT-SIZE: 9pt; WIDTH: 50px; CURSOR: hand" οnclick=hidead(); align=right>
关闭 ×
</DIV>
</div>
<script LANGUAGE="JavaScript">
var xPos = 20;
var yPos = 10;
img.style.left= xPos;
img.style.top = yPos;
var step = 1;
var delay = 40;
var width, height, Hoffset, Woffset;
var y = 1;
var x = 1;
var interval;
img.visibility = "visible";
function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
if (y) {
yPos = yPos + step;
} else {
yPos = yPos - step;
}
if (yPos < 0) {
y = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
y = 0;
yPos = (height - Hoffset);
}
if (x) {
xPos = xPos + step;
}
else {
xPos = xPos - step;
}
if (xPos < 0) {
x = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
x = 0;
xPos = (width - Woffset);
}
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
}
var itl= setInterval("changePos()", delay);
img.οnmοuseοver=function() {
clearInterval(itl);
}
img.οnmοuseοut=function() {
itl=setInterval("changePos()", delay);
}
function hidead() {
img.style.display="none";
}
</script>
</body>
</html>
<html>
<head>
<title>My starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<div id="img" style="position:absolute;; width: 100; height: 80">
<img src="./test.jpg" border="0">
<DIV style="FONT-SIZE: 9pt; WIDTH: 50px; CURSOR: hand" οnclick=hidead(); align=right>
关闭 ×
</DIV>
</div>
<script LANGUAGE="JavaScript">
var xPos = 20;
var yPos = 10;
img.style.left= xPos;
img.style.top = yPos;
var step = 1;
var delay = 40;
var width, height, Hoffset, Woffset;
var y = 1;
var x = 1;
var interval;
img.visibility = "visible";
function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
if (y) {
yPos = yPos + step;
} else {
yPos = yPos - step;
}
if (yPos < 0) {
y = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
y = 0;
yPos = (height - Hoffset);
}
if (x) {
xPos = xPos + step;
}
else {
xPos = xPos - step;
}
if (xPos < 0) {
x = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
x = 0;
xPos = (width - Woffset);
}
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
}
var itl= setInterval("changePos()", delay);
img.οnmοuseοver=function() {
clearInterval(itl);
}
img.οnmοuseοut=function() {
itl=setInterval("changePos()", delay);
}
function hidead() {
img.style.display="none";
}
</script>
</body>
</html>