AngularJS ng-mousemoveDirective

AngularJS 参考手册AngularJS Reference Manual


AngularJS Examples

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

<div ng-mousemove="count = count + 1" ng-init="count=0">Move the mouse over me!</div>

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

Try it yourself »

Definition and Usage

ng-mousemoveThe directive tells AngularJS what to do when the mouse moves over an HTML element.

ng-mousemoveThe directive does not override the element's native onmousemove event. When the event is triggered,ng-mousemoveboth the expression and the native onmousemove event will be executed.


Syntax

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

All HTML elements support this directive.


Parameter Values

Value Description
expression The expression to execute when the mouse moves over the element.

AngularJS 参考手册AngularJS Reference Manual

Other Extensions