发布于 2015-01-08 01:44:12 | 503 次阅读 | 评论: 0 | 来源: PHPERZ
这里有新鲜出炉的Zepto.js中文手册,程序狗速度看过来!
Zepto 移动浏览器JavaScript框架
Zepto.js 是支持移动WebKit浏览器的JavaScript框架,具有与jQuery兼容的语法。2-5k的库,通过不错的API处理绝大多数的基本工作。
Zepto.js 是移动端轻量级的JavaScript框架,实现JQuery的大部分API,针对手机上web开发,轻量级的是相对性的减少用户访问流量
Zepto.js 是支持移动WebKit浏览器的JavaScript框架,具有与jQuery兼容的语法。2-5k的库,通过不错的API处理绝大多数的基本工作。
可以到 github上下载zepto的源码也是进行模块划分的
1、return zepto.Z(),返回一个空的zepto对象:
2、return $(context).find(selector)
3、return $(document).ready(selector)
4、if (zepto.isZ(selector)) return selector
5、return $(context).find(selector)
6、return zepto.Z(dom, selector)
1、$(selector,context?) 传入一个选择器返回一个zepto对象
2、$(function(){}) 传入一个函数,dom ready时执行
3、$(html,attrs?) 传入一个html字符串,构建元素,返回一个或zepto对象
4、$(dom obj)传入dom对象返回zepto对象
module | default | description |
---|---|---|
zepto | ✔ | Core module; contains most methods |
event | ✔ | Event handling via on() & off() |
ajax | ✔ | XMLHttpRequest and JSONP functionality |
form | ✔ | Serialize & submit web forms |
ie | ✔ | Add support for Internet Explorer 10+ on desktop and Windows Phone 8. |
detect | Provides $.os and $.browser information |
|
fx | The animate() method |
|
fx_methods | Animated show , hide , toggle , and fade*() methods. |
|
assets | Experimental support for cleaning up iOS memory after removing image elements from the DOM. | |
data | A full-blown data() method, capable of storing arbitrary objects in memory. |
|
deferred | Provides $.Deferred promises API. Depends on the "callbacks" module.When included, $.ajax() supports a promise interface for chaining callbacks. |
|
callbacks | Provides $.Callbacks for use in "deferred" module. |
|
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. This works with both `touch` (iOS, Android) and `pointer` events (Windows Phone). | |
gesture | Fires pinch gesture events on touch devices | |
stack | Provides andSelf & end() chaining methods |
|
ios3 | String.prototype.trim and Array.prototype.reduce methods (if they are missing) for compatibility with iOS 3.x. |