<style type="text/css">
<!--
.a {
position: absolute;
height: 200px;
width:200px;
left: 10px;
top: 20px;
display:;
}
-->
</style>
<script languange="javascript">
var tagH=1;
var tagV=1;
var timeId;
var left=10;
var top=20;
function move(){
document.all.star.style.left=left;
document.all.star.style.top=top;
if ((left<document.body.clientWidth-document.all.star.offsetWidth)&&(tagV==1))
{
left+=5;
}
if ((left>document.body.clientWidth-document.all.star.offsetWidth)||(tagV==0))
{left-=5;tagV=0;}
if (left<3)
{left+=5;tagV=1;}
if ((top<document.body.clientHeight+document.body.scrollTop-document.all.star.offsetHeight)&&(tagH==1))
{
top+=5;
}
if ((top>document.body.clientWidth+document.body.scrollTop-document.all.star.offsetWidth)||(tagH==0))
{top-=5;tagH=0;}
if (top<3)
{top+=5;tagH=1;}
}
function start(){
timeId=setInterval("move()",20);
}
function interval(){
clearInterval(timeId);
}
</script>
水平的都可以来回动,就是垂直的不行,帮我分析一下!