I have a button inside a div. The button should be visible only when mouse is over the div. This works well on PC with mouse. However, on a tablet or phone, mouse over event is triggered when you first touch the div. The problem is that if you touch the place where the button is (although invisible yet), it will make the button visible and trigger its click event at the same time. So, how can I delay the button click event?
Here is my sample code:
<div ng-mouseenter="isMouseOver=true" ng-mouseleave="isMouseOver=false">
<div>OTHER STUFF</div>
<button ng-show="isMouseOver" ng-click="clicked()">Click</button>
</div>