forked from jquery-boilerplate/jquery-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.extend-skeleton.js
37 lines (26 loc) · 1004 Bytes
/
jquery.extend-skeleton.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
/*!
* jQuery extend-based plugin boilerplate
* Author: @oscargodson
* Further changes: @timmywil
* Licensed under the MIT license
*/
/*
As you'll notice below, we're making use of $.fn.extend to create our plugin rather
than opting for $.fn.pluginname. This type of structure may be useful if you need
to add a relatively large number of methods to your plugin. There are however alternatives
to this that may be better suited, including Alex Sexton's prototypal inheritence pattern
which is also included in this repo.
*/
//the semi colon before function invocation is a safety net against concatenated
//scripts and/or other plugins which may not be closed properly.
;(function($){
$.fn.extend({
pluginname: function( options ) {
this.defaultOptions = {};
var settings = $.extend({}, this.defaultOptions, options);
return this.each(function() {
var $this = $(this);
});
}
});
})(jQuery);