The difference between zepto and jquery: The difference between zepto and zepto uses 8 Summary, zeptojquery
When talking about the cause of a strange event, we naturally think of the difference between the two.
The first is the effect:
In jquery, there are two effects: fadeIn and fadeOut, which are used to achieve the effect of fade-out. This is naturally a commo
1. Zepto objects cannot customize eventsFor example, execute: $ ({}). bind (' Cust ', function () {});Results: Typeerror:object has no method ' AddEventListener 'The workaround is to create a node that is out of the document flow as the event object:For example: $ ('). bind (' Cust ', function () {});2. Zepto selector expression: [Name=value] value must be enclosed in double quotation marks "or single quote
The first is the effect:
jquery has Fadein and fadeout two effects, used to achieve the effect of the fade fade, which is naturally a common effect on the PC side. Then our team members of the front-end group Mr Huang is naturally thought that the mobile phone page can also be more dazzling, so added the login box fade effect. Buffering to the user is good.
But what if there are no Fadein and fadeout in the Zepto? Is it really impossible to satisfy
Zepto source code analysis, zepto source codeToday, I took the time to review the source code of Zepto and annotate it according to my own understanding. You are welcome to make a brick. Source code version: v1.1.4 Source: http://zeptojs.com/After analyzing the overall code, sort out the architecture diagram:This time, only the core method $ () is obtained, and t
1. Zepto objects cannot customize eventsFor example, execute: $ ({}). bind (' Cust ', function () {});Results: Typeerror:object has no method ' AddEventListener 'The workaround is to create a node that is out of the document flow as the event object:For example: $ ('). bind (' Cust ', function () {});2. Zepto selector expression: [Name=value] value must be enclosed in double quotation marks "or single quote
Zepto-based plug-ins seamlessly scroll up and move up and down the zepto instance code.
This plug-in is written by the author of this blog. It aims to improve the author's js capabilities and provide some convenience for some js cainiao to use the plug-in. Let's fly over it.
The company's mobile project is based on zepto, and there is a page that requires the tex
Build zepto. js files on mobile terminals and build zepto. js on mobile terminals
Because the files downloaded on zepto's official website http://www.zeptojs.cn/javasdownloadonly contain a few samples, which cannot fully adapt to what we need, and we also need to add the corresponding modules as needed. So we need to build our own zepto. min. js. You can use nod
Zepto basic knowledge (3), zepto basic knowledge
41.HeightHeight () type: numberHeight (value) type: selfHeight (function (index, oldHeight) {...}) type: selfObtains the height of the first element in the object set, or sets the height of all elements in the object set.$ ('# Foo'). height () // 123$ (Window). height () /// 838 (viewport height)$ (Document). height () // 22302
42.HideHide () type: selfYou c
Zepto. js, zepto. jstap
The example in this article describes how the tap event in zepto. js blocks bubbles. Share it with you for your reference. The details are as follows:
Recently, I was working on a Mobile website that wanted to use jQuery Mobile, but the file was too large, so I used zepto. js.
Because the use
Zepto. js custom packaging integration with other modules building process, zepto. js Process
1. First install node. js and npm package management tools on your computer;
2. Download The zepto. js source file package from github to a local disk (for example, E: \ Learning \ JS );
Address: https://github.com/madrobby/zept
Read core methods and zepto. jscore in zepto. js Core.
Learn zepto. js, references: http://www.zeptojs.cn/
Like jQuery, its selection symbol is $;
The first contact is
$. () Select
$(selector, [context]) ⇒ collection$(
$('div') //=> all DIV elements on the page$('#foo') //=> element with ID "foo"// generate elements from HTML$("
$. Each traverses arrays and o
Swiper is generally used in mobile touch and carousel charts, as well as scrolling slide screens for moreThrough the Zepto issue found seemingly android default WebKit and Zepto not part-time capacity (or other?) ), you can use Firefox in AndroidEncounter the same problem, the default browser in Android 4.4 and UC are not support triggering Swiper event, Chrome can, landlord is how to solve it?
How powerful is $. proxy () in zepto ?, Zepto. proxy to the end
Well, it's actually the title party. Haha, I just want to summarize the usage of $. proxy () in my work.
I. Syntax:
$. Proxy () has two syntax types:
1) $. proxy (fn, context), fn is a function, and context is the context for executing the fn function.
For example:Var obj = {name: 'zepto'}, handler =
I. THE sameOriginally a library developed for mobile, Zepto is a lightweight alternative to jquery because it has a similar API to jquery and smaller files. Zepto's biggest advantage is its file size, only 8k, is the smallest of the currently fully functional libraries, although not very large, Zepto provides the tools sufficient to meet the needs of the development process. Most of the common APIs and meth
Zepto, because of its small size, provides almost the same API as jquery, and it does replace the huge jquery library at the mobile end. Then the development of Zepto Plug-ins and jquery plug-ins a little different, Jquery.hwSlide.js plug-in package based on the jquery version of the plug-in to Zepto version.
Html
The HTML section is simple, a slider list #hwsl
The first is the effect:jquery has Fadein and fadeout two effects, used to achieve the effect of the fade fade, which is a common effect on the PC side. Then our front-end group of members Mr Huang naturally thought that the mobile phone page can also be more dazzling, so added the login box fade effect. The effect of buffering the user is good.However, Zepto does not have Fadein and fadeout, how to do? Is it really impossible to satisfy Mr Huang's wi
: transparent transparent blue; border-style: none dotted solid;}
JQuery uses .width() and .css(‘width‘) both return 0 , and the height is the same;
Zepto uses .width() return 40 , using .css(‘width‘) return 0px .
So, this scenario, JQuery uses .outerWidth() / .outerHeight() ; Zepto use .width() / .height() .2.offset ()
Zepto.js: Return top , left , width ,height
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.