[pmwiki-users] Including an Accordion widget
design5 at softflow.co.uk
Tue Feb 15 12:20:05 CST 2011
Tuesday, February 15, 2011, 5:46:45 PM, Harald C. wrote:
> If there is an empty line between the >><< and the following e.g.
> !!![[##2 Section 2]] the section 2 content in this example will not be
> shown if one clicks on the section 2 header, but on the section 3 header
okay, thanks, I see the problem:
PmWiki creates divs for the empty lines, so my method
of creating the array for the section divs fails.
Here is a fix:
change in the script in function HideDivs(obj)
var d = el.getElementsByTagName(\"DIV\");
var d = el.getElementsByClassName(\"acc\");
With this fix the class name of the section divs becomes important,
so you need to use >>acc<<
Replace 'acc' in the script code with whatever class name you prefer
to use, but then use the class name in all hideable divs.
My improved recipe to come also uses class names to identify the
section divs, and probably a config variable to choose one's
preferred class name.
More information about the pmwiki-users