tiny-events.js - Normalized events for tinyJS

tiny-events.js provides the normalized Events mouseenter, mouseleave, drag and drop.

Download

tiny-events.js [1866b] - tiny-events-min.js.gz [435b]

Hint

Die normalisierten Events benötigen lediglich tiny.js. Andere Scripte sind nicht erforderlich.

Usage

Die normalisierten Events sind kurz nach dem Einbinden verfügbar und können beliebig wie DOM-Events über t.e bzw. t._.e genutzt werden.

mouseenter/mouseleave

The twin events mouseenter und mouseleave are the normalized pendants to mouseover and mouseout. Mouseenter will be called if the mousecursor wanders over an element (but not if coming from a child-element), while mouseleave is triggered if the curser wanders off the element (but not into a child).

drag/drop

The event drag triggers if an element is held with the mousebutton and moved. Drop is triggered when the button is released.

Example

If the mouse enters the Example field (even if wandering over its children), its background will darken slightly. The black box can be dragged and dropped (even over the borders of its parent).