AngularJS ng-mouseenterDirective

AngularJS 参考手册AngularJS Reference Manual


AngularJS Example

Execute an expression when the mouse pointer passes over an element:

<div ng-mouseenter="count = count + 1" ng-init="count=0">Mouse over me!</div>

<h1>{{count}}</h1>

Try it Yourself »

Definition and Usage

ng-mouseenterThe directive tells AngularJS what operation to perform when the mouse passes over an HTML element.

ng-mouseenterThe directive does not override the element's native onmouseenter event. When the event is triggered,ng-mouseenterboth the expression and the native onmouseenter event will be executed.


Syntax

<element ng-mouseenter="expression"></element>

All HTML elements support this directive.


Parameter Value

Value Description
expression The expression to be executed when the mouse passes over the element.

AngularJS 参考手册AngularJS Reference Manual

Other Extensions