GitXplorerGitXplorer
t

jquery-pluginconfig

public
2 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
e1e234c7d10009f1ef71e848f52f89bfdc8c2d16

Update version

ttalyssonoc committed 10 years ago
Unverified
045a9ae43d0fc8a7eca7af41e07ff60b5ff4d5ac

Update README

ttalyssonoc committed 10 years ago
Unverified
1f3b0297f0b13f65e8b34197fcac8431891d429e

Add code itself

ttalyssonoc committed 10 years ago
Unverified
538a241eb6af892e16664b7e7db74202a3952118

Add tests

ttalyssonoc committed 10 years ago
Unverified
ad4d2e8bf0f771d028e1b7875426d76dfb7daf48

Add gulpfile

ttalyssonoc committed 10 years ago
Unverified
454cd350a99d2cab32fef36a265bae11bdf8129e

Add bower and npm files

ttalyssonoc committed 10 years ago

README

The README file for this repository.

jquery-pluginconfig

Build Status

Installation

You can install with npm

  $ npm install jquery-pluginconfig

With Bower

  bower install jquery-pluginconfig

Or use some of the files at dist folder.

Usage

Let's say you have a jQuery plugin called my-awesome-plugin. And you want to allow the user to set the configs of that plugin for a given element using data-* attributes.

You can let them do this:

  <div class="my-element" data-my-awesome-plugin-config="hello" data-my-awesome-plugin-config-two="world"></div>div>

And then you can do this:

  var config = $('.my-element').pluginConfig('my-awesome-plugin');

  // You'll get { config: "hello", configTwo: "world"}

  // Then use it

  $('.my-element').myAwesomePlugin(config);

You can also use it internally of your plugin, so the user won't have to call pluginConfig every time.

That's all, folks!