Skip to content
rnglab edited this page Jun 27, 2014 · 15 revisions

Koala :

Welcome to Koala.

Koala is real minimal javascript framework for mobile aplications and can make some operations with DOM(document object model).

Koala is simple and not includes any other framework.

History :

I wrote this very basic framework( koala is a small js object ) for my mobile applications in short time. You know, modern and big frameworks (like jquery) registers many event in dom. Jquery effects, events and other some methods are uses high cpu and memory recources. For any mobile device that means performance problems. If you are developing with phonegap or any html5 framework, memory and cpu usage is very important for you. Whatever, basicly i devoloped koala for this point. Koala works for simple actions(show,hide,select,fadeIn..) in dom with low recource(cpu,memory) usage and not includes any other big framework. Koala has very simple code and many lost features then other complex frameworks.

Functions :

  • get(query) : single dom element (works with native dom selectors)
  • getAll(query) : return NodeList inculedes all elements for query (works with native dom selectors)
  • show(target) : show dom element (display:block)
  • hide(target) : hide dom element (display:none)
  • fadeIn(target,delay) : show element with fadeIn effect
  • fadeOut(target,delay): hide element with fadeOut effect
  • inArray(arr,value) : check given value is in given array

Events:

  • click(target, Callback) : set click listener for given dom element
  • event(eventname, target, Callback) : set listener to given event for given dom element

Basic Usage:

Getting Single Element

koala.get("div#container");

koala.get("div#container a");

var elm = koala.get("div#container");

Getting All Elements For Query

koala.getAll("div a");

var elmNodeList = koala.getAll("div a");

Show Hidden Element

koala.show(elm);

Hide Element

koala.hide(elm);

Show element with fadeIn effect

koala.fadeIn(target, 300);

Hide element with fadeOut effect

koala.fadeOut(target, 300);

Search Value in Array

var arr = Array("banana","apple","pie","wine");

koala.inArray(arr, "wine");

Set Click Event

koala.click(elm, function({ console.log("Koala Click"); }));

Set listener to given event for given dom element

koala.event("mousemove", elm, function(){ console.log("Koala Event") });

Finally:

Koala is just simple small object for now and koala didnt tested all mobile web browsers.

Clone this wiki locally