-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.extend.js
42 lines (40 loc) · 953 Bytes
/
jquery.extend.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Created by mark on 18-1-4.
*/
define(function(require,exports,module) {
var $ = require('jquery');
$.fn.extend({
check: function() {
return this.each(function() { this.checked = true; });
},
uncheck: function() {
return this.each(function() { this.checked = false; });
}
});
//扩展$ 方法
$.extend({
min: function(a, b) {
return a < b ? a : b;
},
max: function(a, b) {
return a > b ? a : b;
}
});
function Test2(container){
this.container = $(container);
this.show = function(){
this.container.find('input').check();
console.log($.min(1,2));
}
}
module.exports = Test2;
});
var test = function(){
this.a = 1;
};
test.prototype = function(){
var add = function(a,b){return a+b;};
return {add:add}
}();
var a = new test();
a.add(2,3);