VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/angularjs-ng-mousemove-directive/

⇱ AngularJS ng-mousemove Directive - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AngularJS ng-mousemove Directive

Last Updated : 29 Jul, 2024

The ng-mousemove Directive in AngularJS is used to apply custom behavior when mousemove event occurs on a specific HTML element. It can be used to display a popup alert when the mouse moves over a specific HTML element. It is supported by all HTML elements. 

Syntax:

<element ng-mousemove="expression">
Contents...
</element>

Parameter value:

  • expression: This parameter depicts when the mouse cursor is moved over the element then the expression will be executed.

Example 1: This example uses the ng-mousemove Directive to change the CSS style. 

Output:

Example 2: This example uses the ng-mousemove Directive to display the alert message. 

Output:

Comment

Explore