Created
March 27, 2011 17:24
-
-
Save patrick99e99/889390 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mouseMove: function(event) { | |
var x = event.pageX, | |
y = event.pageY; | |
if (self.isOutsideOfIcon(x, y) && self.isOutsideOfMenu(x, y)) { | |
// mouse has left bounds.. do something here.. | |
} | |
}, | |
isOutsideOfMenu: function(x, y) { | |
return !self.isWithinXBounds(menu_obj.bounds, x) || !self.isWithinYBounds(menu_obj.bounds, y); | |
}, | |
isOutsideOfIcon: function(x, y) { | |
return !self.isWithinXBounds(icon_obj.bounds, x) || !self.isWithinYBounds(icon_obj.bounds, y); | |
}, | |
isWithinXBounds: function(element_bounds, x) { | |
return x >= element_bounds.left && x <= element_bounds.right; | |
}, | |
isWithinYBounds: function(element_bounds, y) { | |
return y >= element_bounds.top && y <= element_bounds.bottom; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment