Home  >  Article  >  Web Front-end  >  jquery plug-in learning (1)_jquery

jquery plug-in learning (1)_jquery

WBOY
WBOYOriginal
2016-05-16 17:51:08966browse

Closer to home, start learning with me :);

1.jquery has customized the jQuery.extend() and jQuery.fn.extend() methods, among which the jQuery.extend() method can create a global function Or selector, and jQuery.fn.extend() can create jQuery object methods. Let’s talk about it in a long way: Both of these two methods contain a parameter. The parameter only accepts objects with a name/value pair structure, where the name represents the function or method name, and the value represents the function body.

Copy code The code is as follows:

jQuery.extend({
minValue : function(a,b){
return a>b? b:a;
},
maxValue : function(a,b){
return a},
})


Copy code The code is as follows: