in the doc is stated: pos - (integer, optional) The index at which
these objects are to be inserted within the Accordion (defaults to the
end).
here is the relevant code of version 1.2:
if (len && (!test || pos)){
pos = $pick(pos, len - 1);
toggler.inject(this.togglers[pos], 'before');
element.inject(toggler, 'after');
} else if (this.container && !test){
toggler.inject(this.container);
element.inject(this.container);
}
1.) if I want always insert a section at the end (default), I have to
omit pos,
but the statement "(len && (!test || pos))" is always true for an
accordion with at least on toggler/element
so that every following Section is inserted not at the end but before
the last section (@see: pos = $pick(pos, len - 1);)
to correct this I suggest to change the if statement into: "(len && !
test && $defined(pos))"
2.) taken to the word that pos defines the index within the accordion,
one (for instance myself) thinks of the "visual" index, but instead
pos refers to the logical index of the array (this.togglers) and not
to the sequential order in the DOM - that is maybe confusing too....
hope it helps
Oliver