class S2.UI.Behavior


Abstract base class for assigning sets of events.


Certain special functions in a behavior class are used directly as event handlers. They follow one of two naming conventions:

  • on followed by an event name, as in onscroll;
  • an arbitrary identifier, a slash (/), then the pattern above, as in panel/onscroll.

The former will be attached to the element assigned to this.element. The latter will be attached to the element assigned to, where foo is the part before the slash.

Arbitrary properties (like are designated by the options argument of the constructor.



new S2.UI.Behavior(element, options)

Instance methods

  • destroy #

    S2.UI.Behavior#destroy() -> undefined

    Called when the behavior is removed from the element.