Zero is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you use jQuery or Zepto.js, you already know how to use Zero.
Zero began as a fork from Zepto.js but has had its internals restructured to be compatible with all modern browsers.
Zero also has performance improvements while keeping the small size.
Zero.js is licensed under the terms of the MIT License.
Check out Zero's source code and use the build commands.
You will need Node.js installed on your system.
$ npm install
$ npm run-script dist
The resulting files are:
dist/zero.js
dist/zero.min.js
dist/zero.big.js
dist/zero.big.min.js
If you install CoffeeScript globally, you can run make
directly:
$ coffee make dist
$ MODULES="zero event data ..." ./make dist
A pre-compiled version of Zero is available at jsDelivr.
This contains all the modules that are ticked in the Zero modules section below.
A new big pre-compiled version of Zero is also available. The modules that are ticked in the big column are included.
<!-- Uncompressed -->
<script type="text/javascript" src="//cdn.jsdelivr.net/zero.js/latest/zero.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/zero.js/latest/zero.big.js"></script>
<!-- Minified -->
<script type="text/javascript" src="//cdn.jsdelivr.net/zero.js/latest/zero.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/zero.js/latest/zero.big.min.js"></script>
Zero modules are individual files in the "src/" directory.
module | default | big | description |
---|---|---|---|
zero | ✔ | ✔ | Core module; contains most methods |
event | ✔ | ✔ | Event handling via on() & off() |
detect | ✔ | Provides $.os and $.browser information (Deprecated) |
|
fx | ✔ | ✔ | The animate() method |
fx_methods | ✔ |
Animated show , hide , toggle ,
and fade*() methods.
|
|
ajax | ✔ | ✔ | XMLHttpRequest Level 2 functionality |
form | ✔ | ✔ | Serialize & submit web forms |
callbacks | ✔ | Zero equivalent of jQuery $.Callbacks | |
deferred | ✔ | Zero equivalent of jQuery $.Deferred | |
assets | ✔ | Experimental support for cleaning up iOS memory after removing image elements from the DOM. | |
data | ✔ |
A full-blown data() method that stores data directly on to objects in memory.
|
|
selector | ✔ |
Experimental jQuery
CSS extensions support for functionality such as $('div:first') and
el.is(':visible') .
|
|
touch | ✔ | Fires tap– and swipe–related events on touch devices. Works with both touch events and mspointer events. | |
stack | ✔ | Provides andSelf & end() chaining methods |
Get in touch:
Zero currently has no documentation available. Since the API is based off Zepto.js and jQuery, you can use most of their documentation to learn how to use Zero. Please note that most of the API's marked deprecated in the Zepto.js documentation may not be available in Zero.
- Check if the bug is already fixed in the master branch since the last release.
- Check existing issues. Open a new one, including exact browser & platform information. For better formatting of your report, see GitHub-flavored Markdown.
You will need to install PhantomJS.
If you use Node.js it will automatically be installed as a dependancy when you run the npm install
command.
To run the automated tests:
$ npm test
To run a test server, which you can hit with your browsers and devices:
$ npm start
Go to http://your-ip-address:3000/
on your browser and follow the
instructions. For your convenience test failures and exceptions will be
reported to the the console you started the test server in (as well as
the browser console if available).