[pmwiki-users] Including an Accordion widget
haraldc at gmx.net
Tue Feb 15 16:51:48 CST 2011
Hans schrieb am / wrote on 15.02.2011 19:20:
> 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.
Done this, works fine. Thank you.
To make things more easy for me, I also made the following changes:
'<a href="#" onclick="Accordion(\'$1\')">$2</a>');
'<a class="acclink" href="#accordion"
'<a class="acclink" ' as an easy to use css style hook;
'href="#accordion" ' to return directly to the accordion div after
clicking a section header instead of going to the top of the page.
Thought that might be useful for your recipe.
More information about the pmwiki-users