Skip to content

Simple jQuery plugin skeleton with MIT license, with more use of jQuery best practices.

License

GPL-2.0, MIT licenses found

Licenses found

GPL-2.0
GPL-LICENSE.txt
MIT
MIT-LICENSE.txt
Notifications You must be signed in to change notification settings

rdu/jQuery-Plugin-Skeleton

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#jQuery Plugin Skeleton ##What? Simple, it's just a skeleton of a jQuery plugin that you can download, clone, fork, whatever. This skeleton follows best practice and provides a quick framework for rapid plugin development.

##How? First change first line of the MIT license to have your information:

Copyright (c) <Year> <First & Last Name>, <Your Web Site>

And then name your plugin by replacing "PluginName" on line 37:

PluginName: function(method) {

And once more replace "PluginName" on line 43:

$.error('Method ' + method + ' does not exist on jQuery.PluginName');

Finally you can add more code the init method, or add methods of your own in the method variable found on line 26:

var methods = {
	init: function(options) {
		return this.each(function() { //ensures chainability
			if(options) $.extend(settings, options);
			var $this = $(this);
			//YOUR INIT CODE HERE
		});
	}
};

##Note! This plugin allows you to keep on chaining, so, for example:

$('#myelement').PluginName().css({border:'1px solid blue'});

Would run the init function on elements matching #myelement then add a blue border to it after.

##Whats next?

A skeleton that includes ready-to-go functions and callbacks for AJAX based plugins.

##Found a bug?

Submit a bug report above or here:

https://github.com/OscarGodson/jQuery-Plugin-Skeleton/issues

About

Simple jQuery plugin skeleton with MIT license, with more use of jQuery best practices.

Resources

License

GPL-2.0, MIT licenses found

Licenses found

GPL-2.0
GPL-LICENSE.txt
MIT
MIT-LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%