AngularJSng-mouseenter
ディレクティブ
例
マウスカーソルが<div>要素に入ったときに式を実行します。
<div ng-mouseenter="count = count + 1" ng-init="count=0">Mouse over
me!</div>
<h1>{{count}}</h1>
定義と使用法
ng-mouseenter
ディレクティブは、マウスカーソルが特定のHTML要素に入ったときに何をするかをAngularJSに指示します。
AngularJSからのng-mouseenter
ディレクティブは、要素の元のonmouseenterイベントをオーバーライドせず、両方が実行されます。
構文
<element ng-mouseenter="expression"></element>
すべてのHTML要素でサポートされています。
パラメータ値
Value | Description |
---|---|
expression | An expression to execute when the mouse cursor enters an element. |