Brian Miller schrieb:
> Hey listen,
>
> I'd love to be able to pack all of the accordion parameters into classes.
> But, there's just too much information there to make it make-sensical when
> read by people who are a bit slow on the uptake, as Paul hints might be
> the case.
>
> Another good, but not very semantic solution, was to include a script tag
> that only defined an object for containing the parameters. That might be
> a bit cleaner and easier.
>
> - Brian
Here's another solution that may be suitable for you: Do not put all
options into the class, instead simply subclass the accordion class:
<dl class="accordion accDefault"> ... </dl>
<dl class="accordion accExtra"> ... </dl>
You can then have a hash map - that you can also put to the accordion
script where it belongs to - to hold the different set of options:
var accordionOptions = {
accDefault: { /* options here */ },
accExtra: { /* different set of options here */ }
};
And then you could access these options with the aditional class from
your dl as key. That looks a lot cleaner and more important, it
separates the options more clearly from your HTML again. If you need to
change the options sometime you don't have to edit a bunch of templates
again, you can then simply edit the options in one place.
What do you think?
-- Klaus
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/