English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

AngularJS ng-mouseover instruction

AngularJS Reference Manual

!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/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 over me!/div>
<h1>{{count}}</h1>
<p>This example calculates the variable "count" automatically when the mouse is moved over the DIV element, 1。</p>
</body>
</html>
Test and see ‹/›

Definition and Usage

ng-mouseover The directive is used to tell AngularJS what operation to perform when the mouse is moved over the specified HTML element.

ng-mouseover The directive does not override the element's native onmouseover event, when the event is triggered,ng-mouseover Both the expression and the native onmouseover event will be executed.

Syntax

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

All HTML elements support this directive.

Parameter Value

ValueDescription
expressionExpression executed when the mouse is moved over an element.

AngularJS Reference Manual