source code:
<html>
<head>
<style>
#circleA {
background:red;
width:100px;
height:100px;
border-radius:50px;
position:absolute;
}
#circleB {
background:green;
width:100px;
height:100px;
border-radius:50px;
position:absolute;
}
</style>
</head>
<body>
<div id='textArea' style='font-size:30px;'>
两个圆的圆心之间的距离 如果 小于两个圆的半径和 则 两个圆一定碰撞了!
</div>
<div id='circleA' style='left:500px; top:400px;'></div>
<div id='circleB' style='left:300px; top:290px;'></div>
<script>
var circleACell = document.getElementById('circleA');
var circleBCell = document.getElementById('circleB');
var textAreaCell = document.getElementById('textArea');
window.onmousemove = function(){
var e = event