This repository has been archived by the owner on Jun 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Features
Cyrille Bogaert edited this page Apr 16, 2015
·
29 revisions
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);
A minimalist assertion library
assert(true, 'should pass');
A minimalist queue processor
startQueue(items, 3);
callNextItem(items);
on(items, 'complete', listener);
Collection of libraries to handle DOM elements.
getElements('div');
show(element);
hide(element);
addClass(element, 'article');
removeClass(element, 'article');
hasClass(element, 'article');
append(container, element);
prepend(container, element);
remove(element);
empty(element);
Handle dom events
enableDomEvents();
disableDomEvents();
on(element, 'click', clickHandler);
removeListener(element, 'click', clickHandler);
domReady(initFunction);
eachElement(elements, iterator);
is(element, 'div');
isElement(element);
isWindow(window);
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'});
Element size and position
getHeight(element);
getWidth(element);
getSize(element);
getPosition(element);
getOffset(element);
getPositionFromViewport(element);
Request animation frame wrapper
enableAnimationLoop(object);
on(object, 'enter frame', listener);
disableAnimationLoop(object);