我有一个元素:
<span ng-mouseenter="showIt()" ng-mouseleave="hideIt()">Hover Me</span>
<div class="outerDiv" ng-show="hovering">
<p>Some content</p>
<div class="innerDiv">
<p>More Content</p>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是JS:
// mouseenter event
$scope.showIt = function () {
$scope.hovering = true;
};
// mouseleave event
$scope.hideIt = function () {
$scope.hovering = false;
};
Run Code Online (Sandbox Code Playgroud)
我希望能够在悬停事件上设置500毫秒的延迟.
我已经对这个问题有了答案,但我再也不能发布8个小时了.我会回来的!