Skip to content
Permalink
Browse files

Core: Intersect methods into the core. Determines when element "a" co…

…ordinates intersects with element "b".
  • Loading branch information...
eduardolundgren committed Nov 10, 2008
1 parent d972cb3 commit 91377e4e5c75146be3f5ca7d3b7b50d75392c89f
Showing with 15 additions and 0 deletions.
  1. +15 −0 ui/ui.core.js
@@ -104,6 +104,21 @@ $.ui = {
has = (e[scroll] > 0);
e[scroll] = 0;
return has;
},

intersectHeight: function(aTop, bTop, bHeight) {
//Determines when "aTop" element coordinate intersects with b element height
return (aTop > bTop) && (aTop < (bTop + bHeight));
},

intersectWidth: function(aLeft, bLeft, bWidth) {
//Determines when "aLeft" element coordinate intersects with b element width
return (aLeft > bLeft) && (aLeft < (bLeft + bWidth));
},

intersect: function(aTop, aLeft, bTop, bLeft, bHeight, bWidth) {
//Determines when element "a" coordinates intersects with element "b"
return $.ui.intersectHeight(aTop, bTop, bHeight) && $.ui.intersectWidth(aLeft, bLeft, bWidth);
}
};

0 comments on commit 91377e4

Please sign in to comment.
You can’t perform that action at this time.