<script type="text/javascript">
var L=30;
var T=50;
var xthin=ythin=true;
var delay=50;
function flydiv(){
var R=document.body.offsetWidth-document.getElementById("mydiv").offsetWidth;
var B=document.body.offsetHeight-document.getElementById("mydiv").offsetHeight;
document.getElementById("mydiv").style.left=L;
document.getElementById("mydiv").style.top=T;
L=L+5*(xthin?1:-1);
if(L<0){
xthin=true;
L=0;
}
if(L>R){
xthin=false;
L=R;
}
T=T+5*(ythin?1:-1);
if(T>B){
T=B;
ythin=false;
}
if(T<0){
T=0;
ythin=true;
}
setTimeout("flydiv()",delay);
}
window.onload=function(){
flydiv();
}
</script>
<body>
<div style="position: absolute;z-index: 3;" id="mydiv">
<img alt="" src="img/date.gif" />
</div>
</body> |
|