Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Lo-fi JavaScript events module.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
CHANGELOG.md
README.md
elo.js Rework .dubEvent() and bump to 1.6.0
elo.min.js
ender.js
package.json
test.html

README.md

elo

elo is a lo-fi cross-browser JavaScript events API that gzips <3k. It's an events library for minimalists. It works as a standalone library or can integrate into a host such as ender.

API (1.6)

elo does not claim the $ namespace, however it can be used as such in a closure.

Methods

Events

  • $.on(element, eventName, handler)
  • $.off(element, eventName, handler)
  • $.one(element, eventName, handler)
  • $.trigger(element, eventName, extraParamsArray?)
  • $.domReady(fn) // call fn when the DOM is ready
  • $.hasEvent(eventName, element|tagName?)
  • $(stack).on(eventName, handler)
  • $(stack).off(eventName, handler)
  • $(stack).one(eventName, handler)
  • $(stack).trigger(eventName, extraParamsArray?)
  • $(document).ready(fn)
  • $.fn.dubEvent(shorthandEventNames)

Data

  • $.data(object, key?, value?)
  • $.removeData(object, keys?)
  • $.cleanData(object)
  • $(stack).data(key, value?)
  • $(stack).removeData(keys)

Utils

  • $.each(stack, callback, thisArg?, breaker?)
  • $(stack).each(callback, thisArg?, breaker?)

elo()

The elo() function is a simple OO wrapper that works very much like the jQuery function.

  • elo(element) // wrap a DOM element
  • elo(stack) // wrap NodeList or array
  • elo(selector, context) // match a selector string via querySelectorAll
  • elo(fn) // ready shortcut - fn calls like fn.call(document, elo)

Compatibility

Supports all major browsers. Tested in: Chrome, FF3+, Opera, IE7+, Safari. Please report issues here.

License: MIT

Copyright (C) 2012 by Ryan Van Etten

Something went wrong with that request. Please try again.