js、jquery扩展
来源:互联网 发布:淘宝介入怎么操作 编辑:程序博客网 时间:2024/09/21 06:32
js扩展:
1.string扩展:
String.portotype.ResetBlank =functions(){}
str.ResetBlank ();
2.数字扩展:
Number.portotype.LenWithZero=function(){}
3.数字扩展:
Array.portotype.Min2Max=function(){}
总结:
类型.prototype.扩展方法名
jquery扩展:
1.类级别扩展:
a.定义全局函数:
jQuery.foo=function(){} 使用:$.foo();
b.使用extend定义:
jquery.extend({foo1:function(){}}) 使用:$.foo1();
c.使用命名空间定义:
jquery.plugin={foo2:function{}} 使用:$.plugin.foo2();
2.对象级别扩展:
(function($){
$.fn.foo4 = function() {
alert('对象级别插件fn方式');
}
})(jQuery);
使用:$('#test').foo4();
0 0
- js、jquery扩展
- js,jquery 添加扩展方法
- JS 控件 jQuery扩展函数
- JS和JQuery扩展方法
- 扩展jQuery跨域加载js文件
- jquery.validate.unobtrusive.js 添加扩展方法
- 扩展JQuery和JS的方法
- 使用jquery.qrcode.js扩展配置笔记
- jQuery Easing.js 动画效果扩展
- 模仿JQuery.extend函数扩展自己对象的js代码
- 模仿JQuery.extend函数扩展自己对象的js代码
- 扩展了JQUERY.EASYUI功能的几个JS
- 利用jquery的易扩展特性简化JS的开发
- jquery插件-cityselect.js扩展(支持4层联动)
- JQuery 扩展
- jquery扩展
- jquery 扩展
- jquery 扩展
- 递归与分治策略(1)
- 杭电 HDU 1570 A C
- hdu 3038 How Many Answers Are Wrong(带权并查集+树的性质)
- 局部变量、全局变量、堆、堆栈、静态和全局
- [LinkedIn] Implement a thread safe hashtable
- js、jquery扩展
- 解决unix与windows文本结尾不匹配的问题
- linux下eclipse中windows->preferences下看不到Hadoop MapReduce的配置项
- android edittext 点击回车会响应两次的解决方案
- OpenCv中用hough变换检测直线,有图有真相
- hdu 2052 Picture
- python-pygame 安装
- 中国人的一天
- 第五周 课后实践:阅读程序(1)(2)(3)