Add one ore more Event Listeners

Add one ore more Event Listeners

Topic Progress:

Add one ore more Event Listeners

When you need commands which are executed immediately, just add them after line 6.

Add after line 6 the click Event in case you want to manipulate an object when looking at it for a longer time or click it with the mouse

In the left image we see the cursor and the red box. When clicking on it (or looking at it for a longer time), the position and color of theĀ  box changes (right picture).

In stead of choosing click as an event handler, we could use mouseenter (and mouseleave). The change happens immediately:

To bring back the object when looking at another object, we need the mouseleave event:


Comments are closed.