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