AngularJS ng-mouseover directive
AngularJS instance
Execute the expression when the mouse pointer moves onto 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-mouseover="count = count + 1" ng-init="count=0">Move the mouse to me!</div><h1>{{count}}</h1><p>This instance will automatically add 1 when the mouse is moved to the DIV element. </p></body></html>Definition and usage
The ng-mouseover directive tells AngularJS what to do when moving to a specified HTML element.
The ng-mouseover directive will not overwrite the element's native onmouseover event. When the event is triggered, both the ng-mouseover expression and the native onmouseover event will be executed.
grammar
<element ng-mouseover="expression"></element>
All HTML elements support this directive.
Parameter value
| value | describe |
|---|---|
| Expression | An expression executed when the mouse moves onto an element. |
The above is the information compilation of the AngularJS ng-mouseover instruction. We will continue to add it later. Thank you for your support!