注意:当前1.1.3版本的zepto,已经有模块来支持wp8

原先的zepto,通过__proto__赋值,来使dom继承到$.fn方法,

无奈IE11之前的IE10,IE9不支持这种写法,

所以我们只能自己手动把方法添加到dom

// `$.zepto.Z` swaps out the prototype of the given `dom` array
// of nodes with `$.fn` and thus supplying all the Zepto functions
// to the array. Note that `__proto__` is not supported on Internet
// Explorer. This method can be overriden in plugins.
zepto.Z = function(dom, selector) {
dom = dom || []

// 支持ie10,主要是支持wp8
if(navigator.userAgent.indexOf("MSIE 10") > -1){
for(var func in $.fn){
dom[func] = $.fn[func];
}
}
else{
dom.__proto__ = $.fn
}

dom.selector = selector || ''
return dom
}

修改zepto源代码,使支持wp8的ie10的更多相关文章

  1. 【server端学习】修改Apache配置使支持shtml

    主要工作:修改httpd.conf文件[步骤一]去掉下面两行的注释#AddType text/html .shtml #AddOutputFilter INCLUDES .shtml [步骤二]在Op ...

  2. 修改浏览器accept使支持@ResponseBody

    原始:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 application/json,text/javascript, ...

  3. Zepto源代码分析一~核心方法

    今天抽出时间复习了一下Zepto的源代码,依照自己的理解进行凝视. 欢迎大家拍砖. 源代码版本号:v1.1.4 源代码下载地址:http://zeptojs.com/ 分析总体代码之后,整理出架构图: ...

  4. 在Android系统中修改Android.mk使其同时编译rgb2565和rgb2888(向out/host/linux-x86/bin/下新增加一个工具命令)【转】

    本文转载自:http://blog.csdn.net/mu0206mu/article/details/7514559 在Android系统中修改android.mk使其同时编译rgb2565和rgb ...

  5. Zepto源代码分析之二~三个API

    因为时间关系:本次仅仅对这三个API($.camelCase.$.contains.$.each)方法进行分析 第一个方法变量转驼峰:$.camelCase('hello-world-welcome' ...

  6. Android手游《》斗地主完整的源代码(支持单机和网络对战)

    Android手游<斗地主>完整的源代码(支持单机和网络对战)下载.一个很不错的源代码. 斗地主掌游是一个独特的国内社会斗地主棋牌游戏,之后玩家可以下载网上斗地主和全世界.掌游斗地主特点: ...

  7. JS 在页面上直接将json数据导出到excel,支持chrome,edge,IE10+,IE9,IE8,Safari,Firefox

    JS 在页面上直接将json数据导出到excel,支持chrome,edge,IE10+,IE9,IE8,Safari,Firefox <html> <head> </h ...

  8. zepto.js不支持scrollTop的解决办法

    zepto.js不支持animate({ scrollTop: 100},1000); 可以在移动端使用原生window.scrollTop(x,y);简便

  9. 修改json源码支持datetime序列化

    修改json源码支持datetime序列化 import json import datetime now = datetime.datetime.today() json.dumps(now) 抛出 ...

随机推荐

  1. HDU--杭电--1195--Open the Lock--深搜

    Open the Lock Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) To ...

  2. vs2012调试时为什么会出现clr.dll与mscordacwks.dll版本不匹配

    第一次开发wpf程序,就遇到了上述问题,最后发现是因为vs2012默认用的是.net4.5,将版本改为.net4就好了,问题解决

  3. 替换运算符 shell

        ${变量:-word}如果变量存在且非空,则返回其值:否则返回word                  用于:如果变量未定义,则返回默认值即word      ${变量:+word}如果变量 ...

  4. B. Painting Pebbles

    B. Painting Pebbles time limit per test 1 second memory limit per test 256 megabytes input standard ...

  5. Subsequence

    Description A sequence of N positive integers (10 < N < 100 000), each of them less than or eq ...

  6. javascript 制作的美化select,利用cookie保存选择

    可以看一下动画 下面是代码 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...

  7. iOS 新特性关键字

    1.用来修饰属性,或者方法的参数,方法的返回值 /** nullable:表示可以传空 */ //@property (nonatomic, strong, nullable) NSString *n ...

  8. Samba服务详解

    Samba文件服务器 本章结构 服务简介 SMB协议 Server Message Block,服务消息块 CIFS协议 Common Internet File System,通用互联网文件系统 S ...

  9. MySQL中的保留字

    本文转载自:http://www.cnblogs.com/lawdong/archive/2010/08/08/2357903.html ADD ALL ALTER ANALYZE AND AS AS ...

  10. Linux 内核配置和编译

    Linux 内核配置和编译 一.配置内核 (1). 为什么要配置内核 1. 硬件需求 2. 软件需求 选出需要的,去掉不要的 (2). 如何配置内核 1. make  config 基于文本模式的交互 ...