Full API documentation.

util (Namespace)


Provides varies utilities and commons functions that are used across all components.





Cancel pointers if the user scroll.


Fixes the broken iPad/iPhone form label click issue.


Determines if a specified element is an instance of $.

ch.util.is$($('element')); // true


Returns true if an object is an array, false if it is not.

ch.util.isArray([1, 2, 3]); // true


Reference to the vendor prefix of the current browser.

ch.util.VENDOR_PREFIX === 'webkit';

.zIndex Number

zIndex values.

ch.util.zIndex += 1;




Adds CSS rules to disable text selection highlighting.

  • jQuery - jQuerySelector : or Zepto Selector to disable text selection highlighting.

.clone(obj) → {Object}


Returns a shallow-copied clone of the object.

  • obj - Object : The object to copy.

.getOffset(el) → {Object}


Get the current offset of an element.

  • el - HTMLElement : A given HTMLElement.

.getOuterDimensions(el) → {Object}


Get the current outer dimensions of an element.

  • el - HTMLElement : A given HTMLElement.

.getPositionedParent(el, position) → {HTMLElement}


Get the current parentNode with the given position.

  • el - HTMLElement : A given HTMLElement.
  • position - String : A given position (static, relative, fixed or absolute).
ch.util.getPositionedParent(el, 'fixed');

.getScroll() → {Object}


Get the current vertical and horizontal positions of the scroll bar.


.getStyles(el, prop) → {CSSStyleDeclaration}


Gives the final used values of all the CSS properties of an element.

  • el - HTMLElement : The HTMLElement for which to get the computed style.
  • prop - string : The name of the CSS property to test.
ch.util.getStyles(HTMLElement, 'color'); // true

.inherits(obj, superConstructor) → {Object}


Inherits the prototype methods from one constructor into another. The parent will be accessible through the obj.super property.

  • obj - function : The object that have new members.
  • superConstructor - function : The construsctor Class.
ch.util.inherit(obj, parent);

.isUrl(url) → {Boolean}


Checks if the url given is right to load content.

  • url - String : The url to be checked.
ch.util.isUrl('www.chico-ui.com.ar'); // true

.prevent(event) → {Object}


Prevent default actions of a given event.

  • event - Event : The event ot be prevented.