现在网上流行会弹来弹去的浮动图片
想给自己的网页也加上一个吗?其实很简单
把下面这段代码加到网页的之间
然后
把图片换成你中意的就OK啦!
到这里下载示例代码
< div id=img >
< a _blank>
< img src=eschoolbuttongif >
< /a>
< /div>
< SCRIPT LANGUAGE=JavaScript>
< ! Begin
var xPos = ;
var yPos = documentbodyclientHeight;
var step = ;
var delay = ;
var height = ;
var Hoffset = ;
var Woffset = ;
var yon = ;
var xon = ;
var pause = true;
var interval;
imgstyletop = yPos;
function changePos() {
width = documentbodyclientWidth;
height = documentbodyclientHeight;
Hoffset = imgoffsetHeight;
Woffset = imgoffsetWidth;
imgstyleleft = xPos + documentbodyscrollLeft;
imgstyletop = yPos + documentbodyscrollTop;
if (yon) {
yPos = yPos + step;
}
else {
yPos = yPos step;
}
if (yPos < ) {
yon = ;
yPos = ;
}
if (yPos >= (height Hoffset)) {
yon = ;
yPos = (height Hoffset);
}
if (xon) {
xPos = xPos + step;
}
else {
xPos = xPos step;
}
if (xPos < ) {
xon = ;
xPos = ;
}
if (xPos >= (width Woffset)) {
xon = ;
xPos = (width Woffset);
}
}
function start() {
imgvisibility = visible;
interval = setInterval(´changePos()´ delay);
}
start();
// End >
< /script >