Creating a hover event for DOM subscription

This example will illustrate how to use the synthetic event creation API. We'll create a hover event that accepts two functions at subscription time, the first being the function that executes when the hover begins, and the second when the hover ends.

Subscribing to this new event will look like this:

  1. node.on( "hover", onHover, endHover );
node.on( "hover", onHover, endHover );

Hover over me