/** to determine if collision * @param obj Original object * @param dobj target object/function impact (obj, dobj) {var o = {X:getdefa Ultstyle (obj, ' left '), Y:getdefaultstyle (obj, ' top '), W:getdefaultstyle (obj, ' width '), H: Getdefaultstyle (obj, ' height ')} var d = {X:getdefaultstyle (dobj, ' left '), Y:get
DefaultStyle (dobj, ' top '), W:getdefaultstyle (dobj, ' width '), H:getdefaultstyle (dobj, ' height ')
} var px, py; px = o.x <= d.x?
d.x:o.x; PY = o.y <= d.y?
D.Y:O.Y; Judge whether the point is in two objects//view this column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/script/if (px >= o.x &&am P PX <= o.x + o.w && py >= o.y && py <= o.y + o.h && px >= d.x && px <= d.x +
D.W && py >= d.y && py <= d.y + d.h) {return true;
else {return false;
}
}
/** Get Object Properties * @param obj Object * @param attribute/function Getdefaultstyle (obj, attribute) {Retur n parseint (Obj.currentstyle? Obj.currentstyle[attribute]: Document.defaultView.getComputedStyle (obj, false) [
Attribute]); }