AngularJS ng-mouseover 指令
AngularJS 實例
在鼠標指針移動到元素上時執行表達式:
<!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">鼠標移動到我這!</div>
<h1>{{count}}</h1>
<p>該實例在鼠標移動到 DIV 元素時,計算變量 "count" 會自動加 1。</p>
</body>
</html>
定義和用法
ng-mouseover 指令用於告訴 AngularJS 鼠標移動到指定的 HTML 元素上時要執行的操作。
ng-mouseover 指令不會覆蓋元素的原生 onmouseover 事件, 事件觸發時,ng-mouseover 表達式與原生的 onmouseover 事件將都會執行。
語法
<element ng-mouseover="expression"></element>
所有的 HTML 元素支持該指令。
參數值
以上就是對AngularJS ng-mouseover 指令的資料整理,後續繼續補充,謝謝大家支持!