Created
August 7, 2014 04:56
-
-
Save RyanABailey/8f22b9fdc4c31c27c9f3 to your computer and use it in GitHub Desktop.
angularJs hover example
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
$scope.openMenu = function() { | |
// code to expand menu | |
}; | |
$scope.checkCloseLanguageSelector = function () { | |
if (isHovered($('#menu'))) { | |
$scope.closeMenu = false; | |
} | |
}; | |
function isHovered(elt) { | |
var temp = $(elt).parent().find(":hover"); | |
return temp.length == 1 && temp[0] == elt; | |
} | |
$scope.closeMenu = function() { | |
// code to collapse menu | |
}; |
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
<div id="menu" ng-mouseover="openMenu()" ng-mouseleave="checkCloseMenu()"> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment