将自己写的代码进行闭包封装
2016-09-03 12:10
281 查看
引用Zepto时,为防止$与jQuery或其他JS库的$冲突,对Zepto中的$进行闭包
<script src="js/zepto.min.js"></script> <script type="text/javascript"> $(function($){ var clientWidth=$(window).width(); var clientHeight=$(window).height(); $('.inner').css({'width': clientWidth, 'height': clientHeight + 'px'}); var swiper = new Swiper('.swiper-container', { direction: 'vertical', resistanceRatio:0 }); })(zepto);
相关文章推荐
- 笔试题之优化代码
- 特权级代码段之间的转移---任务内特权级变换转移
- 【转】如何拿到半数面试公司Offer——我的Python求职之路
- 特权级代码段之间的转移---任务内无特权级变换的转移
- MyEclipse+CXF框架开发WebService
- php获取当地时间
- php取字符串的第一个字符
- 初遇C#之HelloWorld程序
- 从建筑的角度来看编程
- MATLAB中reshape函数的用法
- (二)java.util.Scanner的使用
- 有章法的学习c++(2)初识输入输出
- 判断字符串中的括号是否匹配
- Java学习笔记之对象传值和引用总结
- Java———Annotation注解(一)*
- 《深度探索C++对象模型》—Function语意学(The Semantics of Function)
- 学习笔记--特权级代码段之间的转移(二)
- IIS7.5 上 配置 PHP 环境
- 学习笔记--特权级代码段之间的转移(一)
- RxJava初步探路(基础篇)