The event utility provides functions to add and remove event listeners, event cleansing. It also tries to automatically remove listeners it registers during the unload event.
This module provides the following classes:
This module is a rollup of the following modules:
DOM event listener abstraction layer
Adds event delegation support to the library.
Adds bubbling and delegation support to DOM events focus and blur.
Adds support for a "hover" event. The event provides a convenience wrapper for subscribing separately to mouseenter and mouseleave. The signature for subscribing to the event is
node.on("hover", overFn, outFn); node.delegate("hover", overFn, outFn, ".filterSelector"); Y.on("hover", overFn, outFn, ".targetSelector"); Y.delegate("hover", overFn, outFn, "#container", ".filterSelector");
Additionally, for compatibility with a more typical subscription signature, the following are also supported:
Y.on("hover", overFn, ".targetSelector", outFn); Y.delegate("hover", overFn, "#container", outFn, ".filterSelector");
Functionality to listen for one or more specific key combinations.
Adds subscription and delegation support for mouseenter and mouseleave events. Unlike mouseover and mouseout, these events aren't fired from child elements of a subscribed node.
This avoids receiving three mouseover notifications from a setup like
div#container > p > a[href]
When the mouse moves over the link, one mouseover event is fired from #container, then when the mouse moves over the p, another mouseover event is fired and bubbles to #container, causing a second notification, and finally when the mouse moves over the link, a third mouseover event is fired and bubbles to #container for a third notification.
By contrast, using mouseenter instead of mouseover, the callback would be executed only once when the mouse moves over #container.
Adds mousewheel event support
Outside events are synthetic DOM events that fire when a corresponding native or synthetic DOM event occurs outside a bound element. The following outside events are pre-defined by this module:
Y.Event.defineOutside(eventType);. By default, the created synthetic event name will be the name of the event with "outside" appended (e.g. "click" becomes "clickoutside"). If you want a different name for the created Event, pass it as a second argument like so:
Y.Event.defineOutside(eventType, "yonderclick"). This module was contributed by Brett Stimmerman, promoted from his gallery-outside-events module at http://yuilibrary.com/gallery/show/outside-events
Adds a window resize event that has its behavior normalized to fire at the end of the resize rather than constantly during the resize.
Define new DOM events that can be subscribed to from Nodes.