Zepto清单

来源:互联网 发布:复杂sql语句优化 编辑:程序博客网 时间:2024/04/28 17:19

Zepto清单

模块建议描述zepto✔

Core module; contains most methods

核心模块,包含初始化Zepto对象的实现,以及dom选择器、css属性操作、dom属性操作

event✔

Event handling via on() & off()

Zepto事件处理库,包含整个dom事件的实现

ajax✔

XMLHttpRequest and JSONP functionality

Zepto ajax模块的实现

form 

Serialize & submit web forms

form表单相关实现,可以删去,移动端来说意义不大

ie✔

Support for Internet Explorer 10+ on the desktop and Windows Phone 8

这个便是为上面那段实现还账的,几行代码将方法属性扩展至dom集合上(所以标准浏览器返回的是一个实例,ie返回的是一个加工后的数组)

detect ✔

Provides $.os and $.browser information

设备判断,检测当前设备以及浏览器型号

fx ✔

The animate() method

animate方法,这里叫fx模块有点让人摸不着头脑

fx_methods 

Animated showhidetoggle, and fade*() methods.

一些jQuery有的方法,Zepto没有的,这里做修复,比如fadeIn fadeOut意义不大

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.

神奇的deferred模块,语法糖,为解决回调嵌套而生

callbacks 

Provides $.Callbacks for use in "deferred" module.

服务于deferred,实际未使用过

selector  ✔

Experimental jQuery CSS extensions support for functionality such as$('div:first') and el.is(':visible').

扩展选择器,一些语法糖

touch X

Fires tap– and swipe–related events on touch devices. This works with both `touch` (iOS, Android) and `pointer` events (Windows Phone).

提供简单手势库,这个大坑,谁用谁知道!!!几个有问题的地方:

① 事件直接绑定至document,性能浪费

② touchend时候使用settimeOut导致event参数无效,所以preventDefault无效,点透等情况也会发生

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.

没有用过

真实项目时,完全可以按照需要选取模块即可

0 0
原创粉丝点击