views:

21

answers:

1

I'm talking with someone else's plugin, not my own. I'd like to do this without touching their code (I'd like to do it in a separate file).

I thought there was a way to do that, something like:

$.defaults.pluginname or something?

+1  A: 

This completely depends on the plugin and how it was written. For the larger ones yes this is typically supported (most of the time) but it's definitely not guaranteed and definitely varies in how they coded the plugin...since there are a dozen different fundamental ways to do it.

If you posted the actual plugin you want to modify we can tell you the best approach do it, but there's no guarantee you can do this without editing its code.

Edit: since you're using the colorbox plugin you can use the exposed settings object to set defaults before calling .colorbox(), like this:

$.colorbox.settings.opacity = 0.5; //background opacity for example

Any of the colorbox options are settable this way.

Nick Craver
I'm using the colorbox plugin
Matthew