AngularJS ng-mouseleave
指令
AngularJS 實例
在鼠標指針離開元素時執(zhí)行表達式:
<div ng-mouseleave="count = count + 1" ng-init="count=0">鼠標從我這移開
me!</div>
<h1>{{count}}</h1>
<h1>{{count}}</h1>
嘗試一下 ?
定義和用法
ng-mouseleave 指令用于告訴 AngularJS 鼠標從 HTML 元素上移開時要執(zhí)行的操作。
ng-mouseleave 指令不會覆蓋元素的原生 onmouseleave 事件, 事件觸發(fā)時,ng-mouseleave 表達式與原生的 onmouseleave 事件將都會執(zhí)行。
語法
<element ng-mouseleave="expression"></element>
所有的 HTML 元素支持該指令。
參數(shù)值
值 | 描述 |
---|---|
expression | 鼠標在元素上移開時執(zhí)行的表達式。 |
更多建議: