Zepto.js is a minimalist JavaScript framework for mobile WebKit browsers, with a jQuery-compatible syntax.
Docs & Download : https://github.com/madrobby/zepto
Zepto.js: a minimalist framework for mobile WebKit browsers
Zepto.js is a minimalist framework for mobile WebKit browsers, with a jQuery-compatible chaining syntax.
100% jQuery coverage is not a design goal, however all APIs provided match their jQuery counterparts.
The ultimate goal is to have a ~5k library that handles most basic dredge work for you in a nice API so you can concentrate on getting stuff done.
Primary target platforms are:
- iOS 4+
- Android 2.2+
- webOS 1.4.5+
Secondary platforms (for plugin/extension development) are:
- Safari 5+ (desktop)
- Chrome 5+ (desktop)
- Other WebKit-based browsers/runtimes
Syntax & features:
Basic call with CSS selector:
$('p>span').html('yoho').css('color:red');
Instead of a selector, a DOM Element, or a list of nodes can be passed in.
The $ function takes an optional context argument, which can be a DOM Element or a Zepto object:
$('span', $('p')) // -> find all <span> elements in <p> elements $('p').bind('click', function(){ $('span', this).css('color:red'); // affects "span" children/grandchildren });
Context and .find calls are equivalent:
$('span', $('p')) // same $('p').find('span') // same
Posted by 홍반장