以下是javascript
function show(layername){
if (!document.getElementById) return false;
if (!document.getElementById(layername)) return false;
var layer = document.getElementById(layername);
layer.style.width = "0px";
layer.style.height = "0px";
layer.style.display = "block";
movement = setTimeout("animation()",0)
}
function animation(){
if (!document.getElementById) return false;
if (!document.getElementById(layername)) return false;
var layer = document.getElementById(layername);
var xpos = parseInt(layer.style.width);
var ypos = parseInt(layer.style.height);
if (xpos == 480 && ypos == 80){
return true;
}
if (xpos xpos+=10
}
if (xpos > 480){
xpos-=10
}
if (ypos ypos+=10
}
if (ypos > 80){
ypos-=10
}
layer.style.width = xpos + "px";
layer.style.height = ypos + "px";
movement = setTimeout("animation()",0);
}
以下是html