API Docs for:
Show:

Events Class

Defined in: latest/events.js:7
Module: DOM
Parent Module: JSFramework

Normalises DOM event handling across browsers

Methods

add

(
  • obj
  • type
  • fn
)

Defined in latest/events.js:23

Add an event handler.

Parameters:

  • obj HTMLElement

    Element to add event handler to

  • type String

    Type of event handler (eg. "click")

  • fn Function

    Function that will handle the event

Example:

var el = document.getElementById('blah');
Events.add(el, 'click', function() { alert('I was clicked!'); });

initPage

(
  • [id=document.body.id]
)

Defined in latest/events.js:95

Onload handler for Daniel15 framework. Calls onload functions depending on the current page. Splits the body ID by hyphen (-), uses first piece as the main object, and other pieces as sub-objects. Non-existant init methods are ignored (no error is thrown).

Example: An ID of "site-projects" would call Page.Site.init() and Page.Site.Projects.init(). site-projects-foo would call Page.Site.init(), Page.Site.Projects.init() and Page.Site.Foo.init(). "blog" would call Page.Blog.init().

Parameters:

  • [id=document.body.id] Object optional

    Page ID

normalizeEvent Normalize the event - Convert IE-specific properties into W3C properties. Only used if the browser is IE

(
  • e
)
Event private

Defined in latest/events.js:55

Parameters:

  • e Event

    The event

Returns:

Event: A modified version of the event

stop

(
  • e
)

Defined in latest/events.js:37

Stop this event from propagating or running the default action

Parameters:

  • e Event

    The event