How do I nested options for plugins in jQuery
Posted
by Oscar Godson
on Stack Overflow
See other posts from Stack Overflow
or by Oscar Godson
Published on 2010-04-12T22:10:24Z
Indexed on
2010/04/12
22:12 UTC
Read the original article
Hit count: 343
I know how to do plugins, but how do I do nested options like:
var defaults = {
spacing:10,
shorten_to:50,
from_start:0,
from_end:2,
classes: {
test:'testing'
}
};
i know that isn't right, i just dont know how to write the proper syntax when I want to do something like this:
$('#breadcrumbs').breadcrumbs({classes{test:'new_example'},spacing:12})
other suggestions are welcome, im in need of the ability to custom class names and there are 7, so rather than making something like test_class, example_class, etc id like it cleaner and neater like the example above.
© Stack Overflow or respective owner