Coder Social home page Coder Social logo

englercj / jquery-plugin-skeleton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oscargodson/jquery-plugin-skeleton

2.0 2.0 1.0 134 KB

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

License: GNU General Public License v2.0

JavaScript 100.00%

jquery-plugin-skeleton's Introduction

#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

jquery-plugin-skeleton's People

Contributors

bganicky avatar englercj avatar oscargodson avatar thatryan avatar wyattdanger avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

rdu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.