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