madcap,
Рабочий вариант для медитации ...
<!DOCTYPE >
<html>
<head>
<title></title>
<style type="text/css">
#field {
padding: 0;
margin: 0;
width: 300px;
height: 200px;
border: 1px solid black;
position:absolute;
background-image: url('fieldbg.jpg');
}
#ball {
position:absolute;
left:0;
top:0;
padding: 0;
margin: 0;
width: 28px;
height: 28px;
border: 1px solid black;
background-color: red;
-moz-border-radius: 14px;
border-radius: 14px;
background-image: url('ballface.jpg');
}
</style>
</head>
<body>
<div id="field">
<div id="ball"></div>
</div>
<script type="text/javascript">
var dx = -2;
var dy = -2;
var ball = document.getElementById('ball');
var left = 0;
var top = 0;
hod();
function hod() {
if (left <= 0 || left >= 272) {
dx = -dx;
}
if (top <= 0 || top >= 172) {
dy = -dy;
}
left+=dx;
top+=dy;
ball.style.top=top+"px";
ball.style.left=left+"px";
window.setTimeout("hod()",63) ;
}
</script>
</body>
</html>