Element functions:

get() // return array of all elements foundget(0) // return first element foundsize() // the number of elements in collectioneach(callback) // iterate over collection, calling callback for every elementindex('selector') // the position of element matching 'selector' in the current collectionfirst() // new collection containing only the first matched elementlast() // new collection containing only the last matched elementadd() // merges collections of elementsfind('selector') // find all children/grandchildren that match the given selectorclosest('selector') // find the first matching element by going upwards starting from the current elementparents(['selector']) // get all ancestors of elements in collection, optionally filtered by a selectorparent() // immediate parent node of each element in collectionchildren('selector') // immediate children of each element in collection, optionally filtered by a selectorsiblings('selector') // elements that share the same immediate parent (siblings) of each element in collection, optionally filtered by a selectornext() // next siblingsprev() // previous siblingsfilter('selector') // reduce the current set of elements to match the given selectoris('selector') // returns true/false if first element matches the selectornot('selector') // remove elements matching 'selector' from the current collectionnot(function(index){returntrue/false;}) // remove elements from current collection if the callback method returns `true`remove() // remove elementhtml('new html') // set the contents of the element(s)html(function(index, oldhtml){ return...; }) // set the contents of the element(s) from a methodhtml() // get first element's .innerHTMLtext() // get first element's .textContenttext('new text') // set the text contents of the element(s)append(), prepend() // like html(), but add html (or a DOM Element or a Zepto object) to element contentsbefore(), after() // add html (or a DOM Element or a Zepto object) before/after the elementappendTo(), prependTo() // reverse appending/prependingshow() // forces elements to be displayed (only works correctly for block elements right now)hide() // removes a elements from layoutoffset() // get object with top: left: width: height: properties (in px)height() // get first elements height in pxwidth() // get first elements width in pxattr('attribute') // get element attributeattr('attribute', 'value') // set element attributeattr('attribute', function(index, oldAttr){ return...; }) // set the value of 'attribute' from a method, for each element in collectionremoveAttr('attribute') // removes an attributedata('name') // gets the value of the "data-name" attributedata('name', 'value') // sets the value of the "data-name" attributecss('css property', 'value') // set a CSS propertycss({ property1: value1, property2: value2 }) // set multiple CSS propertiescss('css property') // get this CSS property of the first element, looks at both .style object properties and the computed styleaddClass('classname') // adds a CSS class nameaddClass(function(index, existingClasses){ return...; }) // adds a CSS class name from a methodremoveClass('classname') // removes a CSS class nameremoveClass(function(index, existingClasses){ return...; }) // removes a CSS class name from a methodhasClass('classname') // returns true of first element has a classname settoggleClass('classname'[, switch]) // adds/removes class, or adds/removes it when switch == true/false
toggleClass(function(index, existingClasses){ return...; }) // adds/removes class from a method
bind(type, function) // add an event listener (see below)
one(type, function) // add an event listener that only fires once
unbind([type [, function]]) // remove event listeners
delegate(selector, type, function) // add an event listener w/ event delegation (see below)
undelegate(selector [, type[, function]]) // remove event listeners w/ event delegation
live(type, function) // add an event listener that listens to the selector for current and future elements
die([, type[, function]]) // remove live listener
trigger(type) // triggers an event
submit() // trigger form submit event
val() // returns the value of the form element
val('value') // sets the value of the form element

CSS Animation

animate(transforms, duration, easing, callback)
animate(transforms, { duration: milliseconds, easing:'...', complete: callback })
// use -webkit-transform/opacity and do an animation,// optionally supply a callback method to be executed after the animation is complete

Non-jQuery functions

pluck(property)
// return property for each element// e.g. pluck('innerHTML') returns an array of all innerHTML properties of all elements found

Environmental information

Zepto includes information about the environment it is running in the $.os object:

$.os.ios// => true if running on Apple iOS$.os.android// => true if running on Android$.os.webos// => true if running on HP/Palm WebOS$.os.touchpad// => true if running on a HP TouchPad$.os.version// => string with version number, "4.0", "3.1.1", "2.1", etc.$.os.iphone// => true if running on iPhone$.os.ipad// => true if running on iPad$.os.blackberry// => true if running on BlackBerry

Building

Zepto.js can be used as-is. However, for best efficiency, run the included build step that uses UglifyJS to minify Zepto.js and will give you an estimate on the compression that is achievable when Zepto.js is served Gzipped.

Loading Zepto

You load Zepto by using

<scriptsrc="/path/to/zepto.min.js"></script>

Or alternatively, you can just stick in the contents of zepto.min.js into a <script> tag
in your HTML for the best loading performance, especially for single-page applications;
no need to load it from an external file!

Let us know in detail what is going on, including the exact browser version you're on
and preferably a test case that can be reached online so we can quickly reproduce the
error.

Better, yet, fix the bug and bask in the glory of being a contributor (see below!).

Contributing!

I'd love some help on this, so please feel free to mess around!

If you don't know how a method should behave, please use jQuery as a reference. Zepto.js should closely emulate it.
Note that emulation of all features of jQuery is not a project goal, rather we want the most useful parts while keeping
to the ~5k minified goal.