javascript - Angularjs mouse enter event -
i change ng-mouse enter event if user hoovered more second on spot event fire seems ng-model-options="{ debounce: 1000 }"
not working event
any ideas ?
<button ng-mouseenter="myevent()" ng-mouseleave="myevent2()" > </button> $scope.flag=false; $scope.myevent = function() { $scope.flag=true; $timeout(function(){ if($scope.flag) { // logic here } }, 1000); } $scope.myevent2 = function() { $scope.flag=false; }
here can set timeout on mouseenter
, , check if flag
made false mouse leave, logic execute if user has not done mouseleave
1 sec
.
Comments
Post a Comment