<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>浮动图片广告</title> </head>
<body> 已测试浏览器:IE6/IE7/IE8/Firefox/Opera/Chrome/Safari
<div id="img" style="LEFT:20px; visibility:hidden;POSITION:absolute; TOP:20px;">
<a href="http://witmax.cn" target="_blank">
<img border=0 src="http://witmax.cn/img/logo.png" width="190px" height="40px">
</a> </div>
<script language="javascript">
<!-- Begin
var xPos = 20;
var yPos = document.documentElement.clientHeight;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
var img = document.getElementById("img");
img.style.top = yPos; function changePos() {
width=document.documentElement.clientWidth;
height=document.documentElement.clientHeight;
Hoffset=img.offsetHeight; Woffset=img.offsetWidth;
img.style.left=xPos+document.body.scrollLeft+"px";
img.style.top=yPos+document.body.scrollTop+"px";
if(yon) {
yPos=yPos+step;
}else {
yPos=yPos-step;
}
if(yPos<0) {
yon=1;
yPos=0;
}
if(yPos>=(height-Hoffset)) {
yon=0;
yPos=(height-Hoffset);
}
if(xon) {
xPos=xPos+step;
}else { xPos=xPos-step;
}
if(xPos<0) {
xon=1; xPos=0;
}
if(xPos>=(width-Woffset)) {
xon=0; xPos=(width-Woffset);
} }
function start() { img.style.visibility="visible"; interval=setInterval('changePos()',delay); }
start();
// End --> </script> </body> </html>