Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Features

Cyrille Bogaert edited this page Apr 16, 2015 · 29 revisions

Core

Event

A publish/subscribe library that works without polluting your objects with methods or properties.

on(object, 'event name', listener);

emit(object, 'event name');

removeListener(object, 'event name', listener);

Assert

A minimalist assertion library

assert(true, 'should pass');

Queue

A minimalist queue processor

startQueue(items, 3);

callNextItem(items);

on(items, 'complete', listener);

Dom

Collection of libraries to handle DOM elements.

Traversing

getElements('div');

Manipulation

show(element);

hide(element);

addClass(element, 'article');

removeClass(element, 'article');

hasClass(element, 'article');

append(container, element);

prepend(container, element);

remove(element);

empty(element);

Event

Handle dom events

enableDomEvents();

disableDomEvents();

on(element, 'click', clickHandler);

removeListener(element, 'click', clickHandler);

domReady(initFunction);

Utils

eachElement(elements, iterator);

is(element, 'div');

isElement(element);

isWindow(window);

Accessors

Getters / setters for element styles and attributes

getStyle(element, 'font-size');

setStyle(element, 'font-size', '16px');

setStyles(element, {top: '10px', left: '10px'});

getAttribute(element, 'title');

setAttribute(element, 'title', 'Hello World');

setAttributes(element, {title: 'Hello World', alt: 'Hello World'});

Dimensions

Element size and position

getHeight(element);

getWidth(element);

getSize(element);

getPosition(element);

getOffset(element);

getPositionFromViewport(element);

Time

Animation Loop

Request animation frame wrapper

enableAnimationLoop(object);

on(object, 'enter frame', listener);

disableAnimationLoop(object);