AngularJS ng-mousemove directive
AngularJS instance
Execute expressions when the mouse pointer moves over an element:
<!DOCTYPE html><html><head><meta charset="utf-8"><script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script></head><body ng-app=""><div ng-mousemove="count = count + 1" ng-init="count=0">When I move the mouse!</div><h1>{{count}}</h1><p>The calculation variable "count" will automatically add 1 when the mouse moves from the DIV element. </p></body></html>Definition and usage
The ng-mousemove directive is used to tell AngularJS what to do when moving on an HTML element.
The ng-mousemove directive will not overwrite the element's native onmousemove event. When the event is triggered, both the ng-mousemove expression and the native onmousemove event will be executed.
grammar
<element ng-mousemove="expression"></element>
All HTML elements support this directive.
Parameter value
| value | describe |
|---|---|
| Expression | An expression that executes when the mouse moves over an element. |
The above is a compilation of the basic knowledge materials of the AngularJS ng-mousemove directive, and will be supplemented later!