Zepto is a lightweight support mobile WebKit browser JavaScript Mobile end framework, framework support jquery syntax, the framework of the compressed package zepto.min.js size only 21K, using server-side gzip compression size only 5~10k, Can say very small, but the function is complete, more out of some touch screen events, it is the only thing that does not support is the evil of IE, but use it to develop iphone and Android Web page is absolutely preferred.
Core Method $ ()
$(selector, [context]) ⇒ collection $(<Zepto collection>) ⇒ same collection $(<DOM nodes>) ⇒ collection $(htmlString) ⇒ collection $(htmlString, attributes) ⇒ collection [v1.0] Zepto(function($){ ... })
Wraps a DOM node by executing a CSS selector, creating an element, or creating an Zepto object from an HTML fragment.
The Zepto collection is an array-like object that has a chained method to manipulate the DOM it points to, except for the direct methods on the object (such as $.extend ), all methods in the Document object are collection methods.
If the content parameter (CSS selector, DOM, or Zepto collection Object) exists in the selector, the CSS selector is only performed in the context of the given node, which is a bit like using $(context).find(selector) .
You can create a DOM node from an HTML string fragment. You can also create nodes by given a set of property mappings. The quickest to create but an element, use, <div> or <div/> form.
When a function is attached to the process DOMContentLoaded of the event. If the page is already loaded, this method will be executed immediately.
$(' Div ')= = All DIV elements on the page$(' #foo ')= = element with ID "foo"Create element:$("<p>Hello</p>")= = The new P elementCreate element with attributes:$( "<p/>" {text: "Hello" id: "greeting" css:{color: ' darkblue ' } }) //=> <p id=greeting style= "Color:darkblue" >Hello</p> //Execute Callback when the page was ready: zepto (function Span class= "NX" >$) {alert ( ' ready to zepto! ' ) }) /span>
jquery CSS extensions are not supported, but the optional "selector" module provides support, such as some common pseudo-selectors that can be executed with existing code or plug-ins.
Lightweight Mobile Frame--zepto.js