Zepto.js-Lightweight mobile development JavaScript framework

Source: Internet
Author: User

Zepto.js is the mobile-side lightweight JavaScript framework that implements most of the jquery APIs for Web development on mobile phones, and lightweight is the relative reduction of user access traffic

Zepto website Address

can be downloaded to GitHub Zepto source code is also for the module division


Zepto Thinking Guide diagram:



Commonly used return object condition:

1. return Zepto. Z (), returns an empty Zepto object:

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)


Common methods:

1, $ (selector,context?) passing in a selector returns a Zepto object

2, $ (function () {}) passed in a function, Dom ready to execute

3, $ (html,attrs?) passing in an HTML string, building an element, returning a or Zepto object

4, $ (DOM obj) incoming DOM object returns Zepto object


Zepto Modules
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 + 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-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 for use in $.Callbacks "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 is missing) for compatibility with IOS 3.x.

Zepto.js-Lightweight mobile development JavaScript framework

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.