johnnyfreeman/revolver — pull request #3 by jannisg (2012-01-08 04:41:38+00:00)
Title: Allow global plugin default override via $.fn.revolver.defaults object.

One can now simply use (anywhere before initializing the plugin instance)

```JavaScript
$.fn.revolver.defaults = {
optName : optSetting,
optName2 : optSetting
};
```
or

```JavaScript
$.fn.revolver.defaults.optName = optSetting;
$.fn.revolver.defaults.optName2 = optSetting;
```

to set 'global' options for all future inits of revolver sliders on the current page.

One can also use this to set up defaults for multiple sliders then reverting the change for others. e.g.:

```JavaScript
// init via default settings.
$('#slider1').revolver();

// turning autoplay off for all future instances.
$.fn.revolver.defaults.autoPlay = false;
// init via default + no autoPlay.
$('#slider2').revolver();

// setting rotationSpeed to 8000 for all future instances.
$.fn.revolver.defaults.rotationSpeed = 8000;
// init via defaults + no autoPlay + rotationSpeed of 8000.
$('#slider3').revolver();

// local options still override defaults as before.
$('#slider4').revolver(
{
autoPlay : false,
rotationSpeed : 2000
}
);
```

I have tested this locally, but I recommend you run it through your test suite before releasing it into the production/`master` branch since my test was quite basic and only checked whether options where still being correctly set or not and whether any JS error were thrown.

Also, this obviously only works on the jQuery implementation of the plugin.
I had a quick look at MooTools (which I haven't used before) and couldn't find out how to implement this. Seeing as you know MooTools quite well yourself, perhaps you know how to implement this yourself?