aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.core.js
diff options
context:
space:
mode:
authorEduardo Lundgren <eduardolundgren@gmail.com>2008-11-10 05:16:22 +0000
committerEduardo Lundgren <eduardolundgren@gmail.com>2008-11-10 05:16:22 +0000
commit91377e4e5c75146be3f5ca7d3b7b50d75392c89f (patch)
treeeed9b8c7f371b9be8455d16498b5cbbc01c8f579 /ui/ui.core.js
parentd972cb3ea81a78911711fc55a70f696e3d808f44 (diff)
downloadjquery-ui-91377e4e5c75146be3f5ca7d3b7b50d75392c89f.tar.gz
jquery-ui-91377e4e5c75146be3f5ca7d3b7b50d75392c89f.zip
Core: Intersect methods into the core. Determines when element "a" coordinates intersects with element "b".
Diffstat (limited to 'ui/ui.core.js')
-rw-r--r--ui/ui.core.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index 402baa1ef..3f5ea2a10 100644
--- a/ui/ui.core.js
+++ b/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);
}
};